3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ok { public function t() { $this->replacer( '*' ); return preg_replace_callback( '/(t)/', array( $this, 'replacer'), 'this is a simple test' ); } private function replacer( $input ) { static $cache = '-'; if ( ! is_array( $input ) ) { $cache = $input; } else { return $cache . $input[1] . $cache; } } } class buggyphp extends ok {} class buggyphptoo extends ok { public function t() { return parent::t(); } } $buggy = new buggyphp(); echo 'Result buggyphp: ' . $buggy->t(); echo "\n"; $buggy = new buggyphptoo(); echo 'Result buggyphptoo: ' . $buggy->t(); echo "\n"; $a = new ok(); echo 'Result ok: ' . $a->t(); exit();
Output for git.master, git.master_jit, rfc.property-hooks
Result buggyphp: *t*his is a simple *t*es*t* Result buggyphptoo: *t*his is a simple *t*es*t* Result ok: *t*his is a simple *t*es*t*

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.99 ms | 401 KiB | 8 Q