3v4l.org

run code in 300+ PHP versions simultaneously
<?php class interpreter { private $_code; public function __construct($code) { if(!is_string($code)) exit('Error while parsing code; Code not conformal.'); $this->_code = $code; $this->parser(); } public function parser($code = null) { if($code === null) $code = $this->_code; $calls = []; $variables = []; preg_match('#(.*)\((.*)\)#', $code, $calls); if($calls && isset($calls[0])) $this->calls($calls); } private function calls(array $calls) { switch($calls[1]) { case 'print': $this->func_print($calls[2]); break; } } private function func_print($arg) { if(preg_match('#^("|\')(.*)("|\')$#', $arg)) $arg = preg_replace('#^("|\')(.*)("|\')$#', '$2', $arg); echo($arg); } } $code = <<<CODE int var = 1; if(var == 1) { console.out.println("Hello World!"); } else { console.out.println("Hi!"); } CODE; $program = new interpreter($code);

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.0070.01417.00
8.3.50.0100.00821.38
8.3.40.0120.00919.17
8.3.30.0150.00319.12
8.3.20.0000.00720.30
8.3.10.0040.00421.80
8.3.00.0070.00023.65
8.2.180.0150.00018.42
8.2.170.0110.01122.96
8.2.160.0070.00720.39
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0030.00519.72
8.2.120.0080.00026.35
8.2.110.0060.00322.20
8.2.100.0110.00018.05
8.2.90.0000.00819.22
8.2.80.0040.00417.97
8.2.70.0030.00617.88
8.2.60.0080.00018.16
8.2.50.0030.00618.07
8.2.40.0060.00322.37
8.2.30.0040.00419.55
8.2.20.0060.00317.87
8.2.10.0080.00018.08
8.2.00.0040.00418.09
8.1.280.0130.00625.92
8.1.270.0120.00922.01
8.1.260.0030.00528.09
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0080.00319.21
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0060.00317.50
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0000.00918.79
8.1.160.0040.00420.86
8.1.150.0000.00718.94
8.1.140.0000.00819.54
8.1.130.0000.00717.68
8.1.120.0000.00717.52
8.1.110.0000.00717.66
8.1.100.0050.00317.61
8.1.90.0030.00817.67
8.1.80.0040.00417.62
8.1.70.0070.00017.53
8.1.60.0000.00817.65
8.1.50.0000.00817.60
8.1.40.0040.00417.62
8.1.30.0040.00417.66
8.1.20.0050.00317.83
8.1.10.0040.00417.71
8.1.00.0040.00417.66
8.0.300.0050.00218.77
8.0.290.0080.00017.00
8.0.280.0030.00318.49
8.0.270.0000.00717.36
8.0.260.0000.00617.29
8.0.250.0000.00717.15
8.0.240.0030.00317.14
8.0.230.0040.00417.21
8.0.220.0070.00017.14
8.0.210.0040.00417.09
8.0.200.0040.00417.07
8.0.190.0070.00317.25
8.0.180.0040.00417.18
8.0.170.0060.00317.13
8.0.160.0030.00517.05
8.0.150.0000.00817.11
8.0.140.0000.00816.96
8.0.130.0060.00013.48
8.0.120.0000.00917.14
8.0.110.0000.00717.08
8.0.100.0040.00417.02
8.0.90.0000.00717.02
8.0.80.0090.00617.16
8.0.70.0050.00317.02
8.0.60.0080.00016.95
8.0.50.0030.00517.16
8.0.30.0130.01017.18
8.0.20.0070.01117.44
8.0.10.0000.00717.29
8.0.00.0070.01416.99
7.4.330.0050.00016.68
7.4.320.0030.00316.86
7.4.300.0000.00716.70
7.4.290.0000.00716.75
7.4.280.0090.00016.82
7.4.270.0030.00316.79
7.4.260.0030.00616.81
7.4.250.0080.00016.67
7.4.240.0040.00416.85
7.4.230.0040.00416.84
7.4.220.0100.01316.82
7.4.210.0090.00616.84
7.4.200.0000.00716.55
7.4.160.0110.00516.77
7.4.150.0100.00717.40
7.4.140.0060.01517.86
7.4.130.0070.01416.77
7.4.120.0080.00916.69
7.4.110.0140.00316.91
7.4.100.0100.00716.85
7.4.90.0140.00416.75
7.4.80.0130.01019.39
7.4.70.0110.00816.59
7.4.60.0140.00316.67
7.4.50.0090.00616.75
7.4.40.0070.01016.52
7.4.30.0190.00316.92
7.4.10.0060.01115.10
7.4.00.0040.01214.92
7.3.330.0030.00413.56
7.3.320.0030.00313.41
7.3.310.0000.00716.59
7.3.300.0000.00716.41
7.3.290.0060.01116.56
7.3.280.0080.00916.58
7.3.270.0030.01517.40
7.3.260.0110.01316.75
7.3.250.0110.00916.65
7.3.240.0090.00916.70
7.3.230.0080.01116.83
7.3.210.0070.01316.80
7.3.200.0060.01019.39
7.3.190.0060.01316.84
7.3.180.0070.00916.79
7.3.170.0090.00916.57
7.3.160.0070.01016.79
7.3.130.0060.01014.99
7.3.120.0080.00814.96
7.3.110.0060.01215.11
7.3.100.0070.00715.31
7.3.90.0060.00915.13
7.3.80.0040.00715.23
7.3.70.0070.00714.95
7.3.60.0080.00615.13
7.3.50.0110.00415.09
7.3.40.0030.01014.70
7.3.30.0090.00615.10
7.3.20.0080.00816.86
7.3.10.0060.00816.64
7.3.00.0030.00816.88
7.2.330.0070.01116.86
7.2.320.0060.01616.91
7.2.310.0060.01217.01
7.2.300.0070.01016.83
7.2.290.0100.01016.87
7.2.260.0030.01615.11
7.2.250.0070.01115.09
7.2.240.0030.01315.16
7.2.230.0070.00715.30
7.2.220.0090.00615.31
7.2.210.0060.00915.28
7.2.200.0090.00315.01
7.2.190.0070.01015.18
7.2.180.0060.00615.03
7.2.170.0030.01015.36
7.2.160.0000.01815.13
7.2.150.0080.00417.13
7.2.140.0060.00917.09
7.2.130.0080.00717.30
7.2.120.0100.00516.95
7.2.110.0090.00416.91
7.2.100.0060.00816.97
7.2.90.0050.00816.90
7.2.80.0070.00616.92
7.2.70.0090.00717.08
7.2.60.0060.00817.18
7.2.50.0080.00717.22
7.2.40.0080.00717.18
7.2.30.0050.01217.33
7.2.20.0080.00517.07
7.2.10.0030.01017.18
7.2.00.0040.00918.04
7.1.330.0070.00715.85
7.1.320.0070.01016.00
7.1.310.0120.00016.24
7.1.300.0060.00915.93
7.1.290.0030.01016.05
7.1.280.0060.00616.13
7.1.270.0050.01015.82
7.1.260.0070.00415.99
7.1.250.0020.01015.99
7.1.240.0000.01215.97
7.1.230.0000.01416.14
7.1.220.0000.01215.80
7.1.210.0030.01016.01
7.1.200.0040.01515.87
7.1.190.0070.00716.02
7.1.180.0060.00915.97
7.1.170.0070.00316.00
7.1.160.0060.00616.05
7.1.150.0000.01415.98
7.1.140.0060.00916.02
7.1.130.0110.00716.19
7.1.120.0080.00816.10
7.1.110.0030.01216.10
7.1.100.0060.00717.37
7.1.90.0100.00316.16
7.1.80.0060.00616.17
7.1.70.0040.00716.55
7.1.60.0070.00917.61
7.1.50.0080.00816.60
7.1.40.0030.01015.75
7.1.30.0030.01015.91
7.1.20.0070.00316.06
7.1.10.0090.00015.89
7.1.00.0030.04319.20
7.0.330.0070.00715.44
7.0.320.0070.00715.27
7.0.310.0040.01415.72
7.0.300.0030.00915.46
7.0.290.0090.00915.38
7.0.280.0060.00615.67
7.0.270.0070.00415.33
7.0.260.0070.00715.62
7.0.250.0000.01215.44
7.0.240.0140.00015.49
7.0.230.0000.01215.61
7.0.220.0040.00415.78
7.0.210.0030.01015.64
7.0.200.0070.00316.17
7.0.190.0090.00315.52
7.0.180.0100.00015.61
7.0.170.0110.00315.71
7.0.160.0040.00415.53
7.0.150.0030.00615.50
7.0.140.0030.00615.64
7.0.130.0120.00315.71
7.0.120.0080.00515.77
7.0.110.0060.00915.51
7.0.100.0060.00915.38
7.0.90.0030.01015.70
7.0.80.0120.00315.48
7.0.70.0100.00715.59
7.0.60.0120.04018.57
7.0.50.0070.04516.62
7.0.40.0090.03416.94
7.0.30.0080.02716.98
7.0.20.0120.02616.94
7.0.10.0050.04917.02
7.0.00.0060.02216.84
5.6.400.0040.00814.45
5.6.390.0130.00014.68
5.6.380.0000.01314.51
5.6.370.0080.00414.59
5.6.360.0000.01014.75
5.6.350.0100.00314.52
5.6.340.0040.01114.79
5.6.330.0040.01114.53
5.6.320.0120.00314.70
5.6.310.0040.01414.73
5.6.300.0070.00714.57
5.6.290.0030.00614.86
5.6.280.0050.02817.67
5.6.270.0100.00714.47
5.6.260.0060.00614.70
5.6.250.0060.00314.37
5.6.240.0000.01214.66
5.6.230.0090.00914.48
5.6.220.0030.01014.51
5.6.210.0100.04017.51
5.6.200.0100.04216.45
5.6.190.0090.04517.52
5.6.180.0250.02917.51
5.6.170.0170.02917.68
5.6.160.0120.04217.57
5.6.150.0060.04416.39
5.6.140.0030.03916.33
5.6.130.0050.03016.43
5.6.120.0100.04417.74
5.6.110.0110.03817.69
5.6.100.0070.02017.85
5.6.90.0050.05117.51
5.6.80.0120.03917.40
5.6.70.0100.00614.47
5.6.60.0100.00014.56
5.6.50.0040.00814.38
5.6.40.0060.00614.42
5.6.30.0090.00614.69
5.6.20.0030.00714.42
5.6.10.0090.00914.62
5.6.00.0070.00214.62
5.5.380.0040.01114.47
5.5.370.0080.00814.75
5.5.360.0090.00914.74
5.5.350.0050.04717.55
5.5.340.0100.03716.28
5.5.330.0070.04517.51
5.5.320.0100.02717.22
5.5.310.0210.04017.25
5.5.300.0040.02016.21
5.5.290.0090.03216.41
5.5.280.0060.04617.62
5.5.270.0030.02317.69
5.5.260.0060.04517.53
5.5.250.0100.02517.54
5.5.240.0080.04117.18
5.5.230.0090.00614.16
5.5.220.0030.00914.34
5.5.210.0060.00614.39
5.5.200.0090.00914.16
5.5.190.0030.00914.52
5.5.180.0090.00914.29
5.5.170.0030.01214.32
5.5.160.0030.00914.25
5.5.150.0060.00614.67
5.5.140.0030.00514.20
5.5.130.0060.00614.28
5.5.120.0080.00814.44
5.5.110.0040.01114.43
5.5.100.0110.00414.31
5.5.90.0070.00714.70
5.5.80.0080.00414.75
5.5.70.0090.00614.61
5.5.60.0030.00914.52
5.5.50.0030.00714.53
5.5.40.0030.01014.42
5.5.30.0000.01014.15
5.5.20.0080.00814.05
5.5.10.0040.01113.85
5.5.00.0080.00414.42

preferences:
50.11 ms | 401 KiB | 5 Q