PHP userland backwards compatibility layer that emulates PHP 5.5+ core functions.

⌈⌋ branch:  upgrade.php


Check-in [87087bb336]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix runkit json_decode mapping, as reported by Lifeboat Fndt.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:87087bb33663a5fde77e61d30c0fc3b0894c502f
User & Date: mario 2015-05-07 03:41:32
Context
2015-05-07
03:54
Move PHP 4.1-5.0 code out into separate include ext/php50.php. Leaf check-in: 4d4222f05d user: mario tags: trunk
03:41
Fix runkit json_decode mapping, as reported by Lifeboat Fndt. check-in: 87087bb336 user: mario tags: trunk
2014-08-14
07:22
Variant of var_export that utilizes php 5.4 array [] syntax. check-in: a33d1695b1 user: mario tags: trunk
Changes

Changes to upgrade.php.

     1      1   <?php
     2      2   /**
     3      3    * api:		php
     4      4    * title:	upgrade.php
     5      5    * description:	Emulates functions from new PHP versions on older interpreters.
     6         - * version:	19.1
            6  + * version:	20
     7      7    * license:	Public Domain
     8      8    * url:		http://freshmeat.net/projects/upgradephp
     9      9    * type:	functions
    10     10    * category:	library
    11     11    * priority:	auto
    12         - * load_if:     (PHP_VERSION<5.2)
           12  + * load_if:     (PHP_VERSION<5.3)
    13     13    * sort:	-255
    14     14    * provides:	upgrade-php, api:php5, json
    15     15    *
    16     16    *
    17     17    * By loading this library you get PHP version independence. It provides
    18     18    * downwards compatibility to older PHP interpreters by emulating missing
    19     19    * functions or constants using IDENTICAL NAMES. So this doesn't slow down
    20         - * script execution on setups where the native functions already exist. It
    21         - * is meant as quick drop-in solution. It spares you from rewriting code or
    22         - * using cumbersome workarounds instead of the more powerful v5 functions.
           20  + * script execution on setups woth native support exists. It's just meant
           21  + * as quick drop-in solution. It spares you from rewriting code or using
           22  + * cumbersome workarounds instead of the richer 5.3+ function set.
    23     23    * 
    24     24    * It cannot mirror PHP5s extended OO-semantics and functionality into PHP4
    25     25    * however. A few features are added here that weren't part of PHP yet. And
    26     26    * some other function collections are separated out into the ext/ directory.
    27     27    * It doesn't produce many custom error messages (YAGNI), and instead leaves
    28     28    * reporting to invoked functions or for native PHP execution.
    29     29    * 
................................................................................
    58     58   /**
    59     59    *                                   ------------------------ OVERRIDE ---
    60     60    *
    61     61    */
    62     62   if (defined("UPGRADEPHP_OVERRIDE") and function_exists("runkit_function_remove")) {
    63     63      ini_set("runkit.internal_override", 1);
    64     64      runkit_function_rename("json_encode", "php::json_encode");
    65         -   runkit_function_rename("json_decode", "php::json_encode");
           65  +   runkit_function_rename("json_decode", "php::json_decode");
    66     66    }
    67     67   
    68     68   /**
    69     69    *                                   ----------------------------- 5.5 ---
    70     70    * @group 5_5
    71     71    * @since 5.5
    72     72    *