3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Thing { public function __call($name, $params) { return 'foo'; } } function can_be_string($var) { return $var === null || is_scalar($var) || (is_object($var) && method_exists($var, '__toString')); } $a = new Thing; var_dump(can_be_string($a)); (string) $a;

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.3.70.0100.00716.63
8.3.60.0100.00716.88
8.3.50.0120.01022.09
8.3.40.0090.00618.80
8.3.30.0110.00418.79
8.3.20.0020.00521.90
8.3.10.0080.00023.45
8.3.00.0080.00022.27
8.2.190.0120.00616.75
8.2.180.0090.00625.92
8.2.170.0070.01018.99
8.2.160.0100.00722.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0080.00022.27
8.2.110.0040.00421.04
8.2.100.0060.00620.36
8.2.90.0030.00619.64
8.2.80.0000.00819.21
8.2.70.0000.00818.05
8.2.60.0000.00717.80
8.2.50.0080.00018.10
8.2.40.0000.00720.41
8.2.30.0000.01019.15
8.2.20.0040.00418.07
8.2.10.0030.00617.93
8.2.00.0050.00217.68
8.1.280.0100.01025.92
8.1.270.0040.00423.85
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00322.07
8.1.230.0070.00420.94
8.1.220.0000.00817.79
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0040.00418.64
8.1.160.0050.00218.77
8.1.150.0030.00320.18
8.1.140.0000.00719.62
8.1.130.0030.00519.03
8.1.120.0030.00317.50
8.1.110.0070.00017.42
8.1.100.0070.00017.48
8.1.90.0000.00717.40
8.1.80.0040.00417.45
8.1.70.0000.00717.36
8.1.60.0040.00417.45
8.1.50.0060.00317.51
8.1.40.0040.00417.41
8.1.30.0000.00817.70
8.1.20.0040.00417.50
8.1.10.0030.00517.56
8.1.00.0000.00817.60
8.0.300.0080.00019.84
8.0.290.0040.00416.75
8.0.280.0000.00818.41
8.0.270.0050.00317.26
8.0.260.0070.00017.26
8.0.250.0070.00016.95
8.0.240.0000.00716.91
8.0.230.0050.00317.07
8.0.220.0040.00416.95
8.0.210.0030.00717.06
8.0.200.0040.00416.95
8.0.190.0030.00316.93
8.0.180.0070.00016.99
8.0.170.0080.00016.98
8.0.160.0030.00517.00
8.0.150.0040.00416.88
8.0.140.0040.00416.91
8.0.130.0000.00513.40
8.0.120.0040.00416.82
8.0.110.0000.00816.90
8.0.100.0000.00717.02
8.0.90.0040.00416.74
8.0.80.0060.01316.88
8.0.70.0000.00816.98
8.0.60.0040.00416.79
8.0.50.0000.00817.02
8.0.30.0070.01017.13
8.0.20.0080.01117.40
8.0.10.0000.00716.96
8.0.00.0140.00317.02
7.4.330.0020.00215.55
7.4.320.0000.00716.64
7.4.300.0000.00616.53
7.4.290.0000.00716.41
7.4.280.0060.00316.37
7.4.270.0030.00316.51
7.4.260.0000.00716.42
7.4.250.0000.00716.48
7.4.240.0040.00416.64
7.4.230.0030.00316.63
7.4.220.0080.01216.44
7.4.210.0070.00716.71
7.4.200.0040.00416.42
7.4.160.0070.00916.56
7.4.150.0130.00817.40
7.4.140.0080.01217.86
7.4.130.0080.00916.61
7.4.120.0140.00516.58
7.4.110.0160.00916.71
7.4.100.0030.01516.48
7.4.90.0100.00716.56
7.4.80.0090.00919.39
7.4.70.0120.00416.53
7.4.60.0070.01016.54
7.4.50.0100.00016.47
7.4.40.0040.01216.71
7.4.30.0060.01016.56
7.4.00.0000.01714.95
7.3.330.0030.00313.29
7.3.320.0000.00513.45
7.3.310.0040.00416.46
7.3.300.0030.00316.30
7.3.290.0070.00816.45
7.3.280.0080.00716.44
7.3.270.0100.00717.40
7.3.260.0120.00516.40
7.3.250.0140.00716.58
7.3.240.0140.00716.54
7.3.230.0130.00616.40
7.3.210.0060.01216.44
7.3.200.0060.00916.44
7.3.190.0140.00616.22
7.3.180.0070.01116.45
7.3.170.0080.01616.50
7.3.160.0060.00916.44
7.2.330.0180.00016.44
7.2.320.0130.00616.51
7.2.310.0090.01216.41
7.2.300.0110.01416.76
7.2.290.0040.01816.36
7.2.60.0060.01016.94
7.2.00.0090.00619.46
7.1.200.0060.00615.83
7.1.100.0100.00018.15
7.1.70.0080.00016.92
7.1.60.0170.00615.46
7.1.50.0030.01016.95
7.1.10.0070.07022.23
7.1.00.0030.06322.38
7.0.200.0030.01416.79
7.0.150.0070.06021.91
7.0.140.0170.05721.82
7.0.130.0070.06021.82
7.0.120.0170.04721.91
7.0.110.0000.07021.96
7.0.100.0100.05721.74
7.0.90.0070.06321.76
7.0.80.0030.07021.92
7.0.70.0100.05721.96
7.0.60.0130.05321.93
7.0.50.0000.08722.00
7.0.40.0100.06021.88
7.0.30.0170.05022.03
7.0.20.0130.06021.88
7.0.10.0130.05021.83
7.0.00.0100.06721.98

preferences:
63.48 ms | 401 KiB | 5 Q