3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const BAR = 30; public function __construct() { $time = 1377176743; $array = array( 1377176711, 1377176712, 1377176714, 1377176717, ); array_filter($array, function($value) use ($time) { echo "evaluating $value against $time and " . static::BAR . "\n"; var_dump($value, $time - static::BAR, $value >= $time - static::BAR); return $value >= $time - static::BAR; }); var_dump($array); } } new Foo;
Output for git.master, git.master_jit, rfc.property-hooks
evaluating 1377176711 against 1377176743 and 30 int(1377176711) int(1377176713) bool(false) evaluating 1377176712 against 1377176743 and 30 int(1377176712) int(1377176713) bool(false) evaluating 1377176714 against 1377176743 and 30 int(1377176714) int(1377176713) bool(true) evaluating 1377176717 against 1377176743 and 30 int(1377176717) int(1377176713) bool(true) array(4) { [0]=> int(1377176711) [1]=> int(1377176712) [2]=> int(1377176714) [3]=> int(1377176717) }

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:
39.06 ms | 402 KiB | 8 Q