3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface NodeInterface { public function eval() : int; } class Node implements NodeInterface { public int $value; public string $sign; public Node $rightChild = null; public Node $leftChild = null; public function eval() : int { if (null != $this->rightChild) { return $this->value; } switch ($this->sign) { case "+": return $this->leftChild->value + $this->rightChild->value; //... } } } $root = new Node(); $root->value = 10; echo $root->eval();

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.0.130.0030.01316.78
8.0.120.0130.00616.68
8.0.110.0090.00916.83
8.0.100.0130.00316.84
8.0.90.0150.00016.79
8.0.80.0080.00816.72
8.0.70.0110.00716.61
8.0.60.0130.00316.77
8.0.50.0110.00016.67
8.0.30.0000.01316.71
8.0.20.0080.00416.86
8.0.10.0110.00016.90
8.0.00.0040.00416.84
7.4.260.0000.01016.27
7.4.250.0030.00616.43
7.4.240.0090.00416.34
7.4.230.0080.00416.32
7.4.220.0130.00016.43
7.4.210.0130.00416.38
7.4.200.0130.00716.29
7.4.190.0150.00316.48
7.4.180.0110.00716.49
7.4.160.0120.00816.35
7.4.150.0140.00016.43
7.4.140.0050.00816.37
7.4.130.0100.00616.35
7.4.120.0120.00616.29
7.4.110.0150.00316.30
7.4.100.0130.00616.29
7.4.90.0150.00216.32
7.4.80.0090.00916.11
7.4.70.0180.00016.10
7.4.60.0140.00316.17
7.4.50.0140.00516.18
7.4.40.0150.00316.05
7.4.30.0170.00016.37
7.4.20.0080.00816.18
7.4.10.0140.00016.28
7.4.00.0080.00416.34
7.3.330.0170.00415.86
7.3.320.0120.00616.16
7.3.310.0160.00316.26
7.3.300.0190.00016.13
7.3.290.0140.00516.17
7.3.280.0160.00416.00
7.3.270.0080.00916.13
7.3.260.0150.00416.21
7.3.250.0150.00416.12
7.3.240.0130.00616.12
7.3.230.0150.00416.16
7.3.220.0180.00316.05
7.3.210.0170.00316.11
7.3.200.0190.00015.87
7.3.190.0130.00516.21
7.3.180.0170.00316.19
7.3.170.0140.00516.10
7.3.160.0160.00416.14
7.3.150.0150.00315.94
7.3.140.0120.00516.00
7.3.130.0140.00516.15

preferences:
146.26 ms | 1394 KiB | 7 Q