PHP-Backporter

Converts PHP 5.3 code to PHP 5.2 code

  • Owner: nikic/PHP-Backporter
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

PHP Backporter

Currently supported

  • const statements (converted into define function calls)
  • __DIR__ magic constant (converted into dirname(__FILE__))
  • Lambda functions (converted into normal functions)
  • Closures (converted into classes)
  • Namespaces (converted into underscore-separated pseudo namespaces)

Limitations

Closures

Closures are represented by a callable array, so calls of type $function() will be transformed
into call_user_func(_array) calls. This can be a problem is functions expect arguments by reference.

Namespaces

The current namespaces implementation is very limited. Most notably it assumes all unqualified uses
of constants and functions are global if a global constant with such a name is defined and local if
it is not. Additionally many dynamic constructs do not work yet.

ToDo

  • Dynamic scope resolution ($className::)
  • Short ternary operator
  • Late static binding (?)
  • __callStatic magic (?)
  • __invoke magic (?)
  • goto (?)
  • ...

Main metrics

Overview
Name With Ownernikic/PHP-Backporter
Primary LanguagePHP
Program languagePHP (Language Count: 1)
Platform
License:
所有者活动
Created At2011-08-05 13:34:46
Pushed At2011-09-04 09:34:24
Last Commit At2011-09-04 11:32:54
Release Count0
用户参与
Stargazers Count22
Watchers Count2
Fork Count5
Commits Count16
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private