3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public bool $bool = false; public int $int = 0; public string $string = ''; public array $arry = []; public stdClass $obj; public function __construct($value) { try { $this->bool = $value; } catch (TypeError $e) {} try { $this->int = $value; } catch (TypeError $e) {} try { $this->string = $value; } catch (TypeError $e) {} try { $this->arry = $value; } catch (TypeError $e) {} try { $this->obj = $value; } catch (TypeError $e) {} } } var_export(new Foo(null)); var_export(new Foo(true)); var_export(new Foo(10)); var_export(new Foo('text string')); var_export(new Foo(array(1,2,3)));

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.60.0110.00316.38
8.3.50.0070.01020.09
8.3.40.0060.01019.12
8.3.30.0110.00318.84
8.3.20.0030.00520.73
8.3.10.0080.00022.11
8.3.00.0040.00420.56
8.2.180.0170.00718.26
8.2.170.0100.00722.96
8.2.160.0030.01022.11
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00326.16
8.2.120.0070.00026.16
8.2.110.0070.00320.96
8.2.100.0060.00717.78
8.2.90.0040.00418.03
8.2.80.0060.00617.97
8.2.70.0000.00817.80
8.2.60.0050.00318.03
8.2.50.0080.00018.10
8.2.40.0000.00820.89
8.2.30.0000.00719.09
8.2.20.0040.00418.03
8.2.10.0040.00419.43
8.2.00.0000.00719.26
8.1.280.0040.01125.92
8.1.270.0050.00323.84
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0100.00022.61
8.1.230.0000.01122.74
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0060.00317.23
8.1.190.0030.00517.23
8.1.180.0030.00618.10
8.1.170.0040.00418.59
8.1.160.0040.00419.07
8.1.150.0000.00718.73
8.1.140.0070.00020.21
8.1.130.0030.00320.11
8.1.120.0030.00317.48
8.1.110.0000.00717.29
8.1.100.0000.00717.45
8.1.90.0030.00617.42
8.1.80.0030.00517.46
8.1.70.0080.00017.39
8.1.60.0030.00517.66
8.1.50.0000.00817.57
8.1.40.0090.00017.56
8.1.30.0000.00817.54
8.1.20.0030.00517.66
8.1.10.0050.00517.61
8.1.00.0050.00317.48
8.0.300.0000.00819.68
8.0.290.0040.00416.63
8.0.280.0030.00318.34
8.0.270.0000.00717.23
8.0.260.0030.00319.91
8.0.250.0000.00716.85
8.0.240.0070.00017.03
8.0.230.0000.00716.95
8.0.220.0030.00316.90
8.0.210.0040.00416.92
8.0.200.0000.00816.96
8.0.190.0000.00716.92
8.0.180.0050.00216.88
8.0.170.0030.00617.00
8.0.160.0050.00316.96
8.0.150.0080.00016.89
8.0.140.0030.00516.90
8.0.130.0000.00613.31
8.0.120.0000.00716.86
8.0.110.0050.00316.94
8.0.100.0050.00216.98
8.0.90.0080.00016.87
8.0.80.0070.00816.92
8.0.70.0000.00816.86
8.0.60.0040.00416.91
8.0.50.0040.00416.95
8.0.30.0090.01216.98
8.0.20.0040.01417.10
8.0.10.0040.00417.15
8.0.00.0130.00416.79
7.4.330.0020.00215.55
7.4.320.0070.00016.43
7.4.300.0000.00616.54
7.4.290.0040.00416.67
7.4.280.0060.00316.50
7.4.270.0040.00416.45
7.4.260.0000.00513.32
7.4.250.0030.00316.59
7.4.240.0020.00516.56
7.4.230.0030.00516.65
7.4.220.0050.00216.59
7.4.210.0100.00616.49
7.4.200.0070.00016.63
7.4.130.0170.00016.51
7.4.120.0140.00716.53
7.4.110.0060.01016.38
7.4.100.0110.00616.43
7.4.90.0070.01116.42
7.4.80.0100.00719.39
7.4.70.0170.00016.54
7.4.60.0070.01616.84
7.4.50.0110.00316.55
7.4.40.0120.00616.44
7.3.330.0070.00016.15
7.3.320.0050.00013.19
7.3.310.0000.00716.17
7.3.300.0040.00416.22
7.3.290.0060.00816.12
7.3.260.0080.00916.32
7.3.240.0100.00916.30
7.3.230.0130.00316.45
7.3.210.0060.01016.35
7.3.200.0060.01016.27
7.3.190.0040.01116.07
7.3.180.0040.01116.35
7.3.170.0100.00616.40
7.3.160.0130.00316.23
7.3.100.0060.00814.29
7.3.90.0050.00914.19
7.3.80.0130.00614.54
7.3.70.0040.00914.31
7.3.60.0100.00414.55
7.3.50.0100.01014.54
7.3.40.0070.01414.27
7.3.30.0090.00614.72
7.3.20.0090.01214.28
7.3.10.0130.00614.47
7.3.00.0050.01014.60
7.2.330.0080.00816.47
7.2.320.0110.00516.20
7.2.310.0090.00916.39
7.2.300.0100.01316.47
7.2.290.0140.00716.47
7.2.230.0150.00014.77
7.2.220.0140.00714.39
7.2.210.0030.01214.14
7.2.200.0070.00714.88
7.2.190.0080.00814.57
7.2.180.0090.00614.46
7.2.170.0060.00914.64
7.2.160.0100.01114.38
7.2.150.0050.01014.87
7.2.140.0030.01314.63
7.2.130.0060.01014.64
7.2.120.0100.01014.56
7.2.110.0090.01114.75
7.2.100.0030.01314.56
7.2.90.0060.01214.72
7.2.80.0090.01214.84
7.2.70.0130.00614.56
7.2.60.0100.01014.59
7.2.50.0080.01214.86
7.2.40.0130.00714.45
7.2.30.0160.00314.61
7.2.20.0090.00614.43
7.2.10.0120.00314.52
7.2.00.0090.00614.86
7.1.320.0100.00713.44
7.1.310.0090.00613.61
7.1.300.0080.00613.61
7.1.290.0090.00613.71
7.1.280.0270.01013.32
7.1.270.0060.01013.58
7.1.260.0030.01113.72
7.1.250.0070.00713.47

preferences:
72.33 ms | 400 KiB | 5 Q