3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Point { public $x; public $y; function __construct($x, $y) { $this->x = $x; $this->y = $y; } } $moves = 10; $mouseX = 100; $mouseY = 100; $point = new Point(200, 200); $delta = 1/(1-rand(0, 99)/100); if (rand(0, 1) == 0) { $delta = 1/$delta; } $xCoefs = array($delta); for ( $i=1; $i<=$moves; $i++ ) { $xCoefs[$i] = $xCoefs[$i-1] - ($delta - 1/$delta)/$moves; } $points = array(new Point($mouseX, $mouseY)); for ( $i=1; $i<=$moves; $i++ ) { $x = $points[$i-1]->X + ($point->X - $points[$i-1]->X)*$xCoefs[$i]/$moves; $y = $points[$i-1]->Y + ($point->Y - $points[$i-1]->Y)/$moves; $points[] = new Point($x, $y); } var_dump($points);
Output for 5.2.6 - 5.6.17, 5.6.19 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 array(11) { [0]=> object(Point)#2 (2) { ["x"]=> int(100) ["y"]=> int(100) } [1]=> object(Point)#3 (2) { ["x"]=> float(0) ["y"]=> int(0) } [2]=> object(Point)#4 (2) { ["x"]=> float(0) ["y"]=> int(0) } [3]=> object(Point)#5 (2) { ["x"]=> float(0) ["y"]=> int(0) } [4]=> object(Point)#6 (2) { ["x"]=> float(0) ["y"]=> int(0) } [5]=> object(Point)#7 (2) { ["x"]=> float(0) ["y"]=> int(0) } [6]=> object(Point)#8 (2) { ["x"]=> float(0) ["y"]=> int(0) } [7]=> object(Point)#9 (2) { ["x"]=> float(0) ["y"]=> int(0) } [8]=> object(Point)#10 (2) { ["x"]=> float(0) ["y"]=> int(0) } [9]=> object(Point)#11 (2) { ["x"]=> float(0) ["y"]=> int(0) } [10]=> object(Point)#12 (2) { ["x"]=> float(0) ["y"]=> int(0) } }
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 array(11) { [0]=> object(Point)#2 (2) { ["x"]=> int(100) ["y"]=> int(100) } [1]=> object(Point)#3 (2) { ["x"]=> float(0) ["y"]=> int(0) } [2]=> object(Point)#4 (2) { ["x"]=> float(0) ["y"]=> int(0) } [3]=> object(Point)#5 (2) { ["x"]=> float(0) ["y"]=> int(0) } [4]=> object(Point)#6 (2) { ["x"]=> float(0) ["y"]=> int(0) } [5]=> object(Point)#7 (2) { ["x"]=> float(0) ["y"]=> int(0) } [6]=> object(Point)#8 (2) { ["x"]=> float(0) ["y"]=> int(0) } [7]=> object(Point)#9 (2) { ["x"]=> float(0) ["y"]=> int(0) } [8]=> object(Point)#10 (2) { ["x"]=> float(0) ["y"]=> int(0) } [9]=> object(Point)#11 (2) { ["x"]=> float(0) ["y"]=> int(0) } [10]=> object(Point)#12 (2) { ["x"]=> float(0) ["y"]=> int(0) } }
Output for 5.6.18
Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 array(11) { [0]=> object(Point)#2 (2) { ["x"]=> int(100) ["y"]=> int(100) } [1]=> object(Point)#3 (2) { ["x"]=> int(0) ["y"]=> int(0) } [2]=> object(Point)#4 (2) { ["x"]=> int(0) ["y"]=> int(0) } [3]=> object(Point)#5 (2) { ["x"]=> int(0) ["y"]=> int(0) } [4]=> object(Point)#6 (2) { ["x"]=> int(0) ["y"]=> int(0) } [5]=> object(Point)#7 (2) { ["x"]=> int(0) ["y"]=> int(0) } [6]=> object(Point)#8 (2) { ["x"]=> int(0) ["y"]=> int(0) } [7]=> object(Point)#9 (2) { ["x"]=> int(0) ["y"]=> int(0) } [8]=> object(Point)#10 (2) { ["x"]=> int(0) ["y"]=> int(0) } [9]=> object(Point)#11 (2) { ["x"]=> int(0) ["y"]=> int(0) } [10]=> object(Point)#12 (2) { ["x"]=> int(0) ["y"]=> int(0) } }
Output for 5.0.0 - 5.2.5
Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$X in /in/ZPlAF on line 30 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 Notice: Undefined property: Point::$Y in /in/ZPlAF on line 31 array(11) { [0]=> object(Point)#2 (2) { ["x"]=> int(100) ["y"]=> int(100) } [1]=> object(Point)#3 (2) { ["x"]=> float(0) ["y"]=> int(0) } [2]=> object(Point)#4 (2) { ["x"]=> float(0) ["y"]=> int(0) } [3]=> object(Point)#5 (2) { ["x"]=> float(0) ["y"]=> int(0) } [4]=> object(Point)#6 (2) { ["x"]=> float(0) ["y"]=> int(0) } [5]=> object(Point)#7 (2) { ["x"]=> float(0) ["y"]=> int(0) } [6]=> object(Point)#8 (2) { ["x"]=> float(0) ["y"]=> int(0) } [7]=> object(Point)#9 (2) { ["x"]=> float(0) ["y"]=> int(0) } [8]=> object(Point)#10 (2) { ["x"]=> float(0) ["y"]=> int(0) } [9]=> object(Point)#11 (2) { ["x"]=> float(0) ["y"]=> int(0) } [10]=> object(Point)#12 (2) { ["x"]=> float(0) ["y"]=> int(0) } }
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ZPlAF on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/ZPlAF on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/ZPlAF on line 4
Process exited with code 255.