3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('PHP_INT_MAX')) { $min = -1; do { $last = $min; $min <<= 1; } while($min < 0); define('PHP_INT_MIN', $last); define('PHP_INT_MAX', ~$last); } class Foo { var $id; function Foo() { static $counter = 0; $this->id = $counter++; if ($counter > PHP_INT_MAX) { $counter = PHP_INT_MIN; } } } $i1 = new Foo; var_dump($i1->id); $i2 = new Foo; var_dump($i2->id); $i3 = new Foo; var_dump($i3->id); $i4 = new Foo; var_dump($i4->id);
Output for git.master, git.master_jit, rfc.property-hooks
NULL NULL NULL NULL

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:
36.15 ms | 401 KiB | 8 Q