3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { public static function baz($string) { return $string . 'baz'; } } class Renderer { public function render(&$elements) { $elements['#printed'] = TRUE; return $elements['#markup']; } } class Foo { protected $renderer; public function __construct($renderer) { $this->renderer = $renderer; } public function fooIt($text) { $variables = array( 'text' => is_array($text) ? $this->renderer->render($text) : $text, ); $text = Bar::baz($variables['text']); print $text; } } $renderer = new Renderer(); $foo = new Foo($renderer); $text_array = array( '#markup' => 'foo', ); $foo->fooIt($text_array);

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.0180.00418.30
8.3.60.0110.00318.43
8.3.50.0200.00522.06
8.3.40.0100.01018.87
8.3.30.0070.00719.09
8.3.20.0070.00020.32
8.3.10.0030.00520.41
8.3.00.0040.00420.96
8.2.190.0120.00318.23
8.2.180.0080.00818.29
8.2.170.0120.00322.96
8.2.160.0030.01020.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.04
8.2.110.0080.00319.34
8.2.100.0090.00317.78
8.2.90.0080.00019.18
8.2.80.0040.00419.32
8.2.70.0040.00417.63
8.2.60.0050.00318.05
8.2.50.0040.00418.07
8.2.40.0050.00318.34
8.2.30.0000.00819.32
8.2.20.0030.00517.67
8.2.10.0070.00018.11
8.2.00.0030.00617.66
8.1.280.0100.01025.92
8.1.270.0060.00323.88
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00622.64
8.1.230.0040.00820.95
8.1.220.0050.00318.77
8.1.210.0060.00618.77
8.1.200.0030.00617.35
8.1.190.0070.00017.53
8.1.180.0030.00618.10
8.1.170.0040.00418.65
8.1.160.0040.00418.74
8.1.150.0070.00318.89
8.1.140.0040.00417.40
8.1.130.0030.00317.76
8.1.120.0040.00417.43
8.1.110.0050.00217.48
8.1.100.0000.00717.29
8.1.90.0030.00717.45
8.1.80.0000.00717.37
8.1.70.0040.00417.30
8.1.60.0050.00317.64
8.1.50.0000.00817.43
8.1.40.0090.00017.44
8.1.30.0030.00617.73
8.1.20.0030.00517.50
8.1.10.0000.00817.49
8.1.00.0030.00617.50
8.0.300.0050.00219.82
8.0.290.0000.00817.04
8.0.280.0000.00718.50
8.0.270.0000.00817.26
8.0.260.0040.00417.27
8.0.250.0030.00316.96
8.0.240.0080.00016.98
8.0.230.0000.00716.99
8.0.220.0000.00716.96
8.0.210.0030.00316.94
8.0.200.0000.00617.01
8.0.190.0000.00716.96
8.0.180.0000.00716.93
8.0.170.0050.00316.91
8.0.160.0000.00716.93
8.0.150.0000.00716.75
8.0.140.0040.00416.82
8.0.130.0050.00013.34
8.0.120.0040.00416.77
8.0.110.0050.00216.77
8.0.100.0070.00016.85
8.0.90.0050.00216.94
8.0.80.0060.01016.82
8.0.70.0040.00416.92
8.0.60.0000.00716.71
8.0.50.0040.00416.70
8.0.30.0070.01317.04
8.0.20.0120.00717.40
8.0.10.0040.00416.84
8.0.00.0110.00616.64
7.4.330.0000.00515.02
7.4.320.0000.00616.46
7.4.300.0030.00316.62
7.4.290.0070.00016.54
7.4.280.0060.00316.62
7.4.270.0030.00316.64
7.4.260.0040.00416.59
7.4.250.0000.00716.34
7.4.240.0040.00316.60
7.4.230.0030.00316.70
7.4.220.0090.00916.59
7.4.210.0000.01416.61
7.4.200.0000.00816.50
7.4.160.0130.00316.43
7.4.150.0130.01017.40
7.4.140.0140.00617.86
7.4.130.0150.00416.61
7.4.120.0090.00816.40
7.4.110.0150.00716.58
7.4.100.0100.01016.44
7.4.90.0140.00316.54
7.4.80.0120.00619.39
7.4.70.0110.00716.53
7.4.60.0120.00416.46
7.4.50.0070.00316.23
7.4.40.0040.01816.49
7.4.30.0140.00316.59
7.4.00.0110.00414.75
7.3.330.0050.00013.39
7.3.320.0030.00313.20
7.3.310.0050.00516.40
7.3.300.0030.00316.35
7.3.290.0070.00716.38
7.3.280.0070.00816.33
7.3.270.0210.00317.40
7.3.260.0120.00616.56
7.3.250.0100.00716.43
7.3.240.0090.01216.40
7.3.230.0140.00316.49
7.3.210.0100.00616.44
7.3.200.0100.00719.39
7.3.190.0070.01116.42
7.3.180.0030.01216.36
7.3.170.0100.00716.31
7.3.160.0040.01216.22
7.3.120.0090.00614.82
7.3.110.0070.01015.01
7.3.100.0120.00314.70
7.3.90.0030.01315.20
7.3.80.0000.01515.04
7.3.70.0030.01014.88
7.3.60.0040.01114.63
7.3.50.0090.00914.76
7.3.40.0060.01014.82
7.3.30.0030.01014.80
7.3.20.0030.00616.81
7.3.10.0100.00616.56
7.3.00.0060.00916.61
7.2.330.0100.00716.80
7.2.320.0150.00316.76
7.2.310.0090.01516.68
7.2.300.0130.00316.82
7.2.290.0070.01016.63
7.2.240.0040.01415.02
7.2.230.0030.01315.09
7.2.220.0030.01415.23
7.2.210.0070.00715.28
7.2.200.0040.01214.87
7.2.190.0030.00715.17
7.2.180.0140.00014.83
7.2.170.0040.01114.96
7.2.160.0030.01015.14
7.2.150.0070.01016.79
7.2.140.0030.00717.02
7.2.130.0000.01416.68
7.2.120.0060.01016.70
7.2.110.0070.00716.99
7.2.100.0030.01317.07
7.2.90.0100.00717.21
7.2.80.0070.00717.05
7.2.70.0070.01116.78
7.2.60.0050.00916.73
7.2.50.0030.01216.89
7.2.40.0070.00717.09
7.2.30.0030.01417.02
7.2.20.0110.00716.92
7.2.10.0140.00017.01
7.2.00.0080.00618.31
7.1.330.0040.01116.01
7.1.320.0040.00816.02
7.1.310.0070.00715.53
7.1.300.0100.00715.66
7.1.290.0070.01015.98
7.1.280.0000.01715.69
7.1.270.0070.00715.88
7.1.260.0090.00615.96
7.1.250.0140.00015.97
7.1.200.0030.00715.87
7.1.100.0100.00718.06
7.1.70.0040.00417.28
7.1.60.0070.01119.34
7.1.50.0040.01117.13
7.1.00.0030.07722.45
7.0.200.0060.00316.49
7.0.140.0030.05022.12
7.0.60.0130.08020.00
7.0.50.0030.04317.84
7.0.40.0000.09720.27
7.0.30.0230.04720.23
7.0.20.0170.05320.30
7.0.10.0100.07020.24
7.0.00.0070.08020.12
5.6.280.0000.07720.79
5.6.210.0130.07720.52
5.6.200.0130.07318.19
5.6.190.0030.07320.52
5.6.180.0530.06320.48
5.6.170.0300.07720.50
5.6.160.0070.08720.47
5.6.150.0030.08318.12
5.6.140.0030.05718.25
5.6.130.0070.06018.14
5.6.120.0070.08721.13
5.6.110.0130.06321.14
5.6.100.0070.06321.03
5.6.90.0000.04320.98
5.6.80.0030.07020.40
5.5.350.0300.07320.37
5.5.340.0030.05717.98
5.5.330.0000.06020.44
5.5.320.0300.05720.20
5.5.310.0200.05020.34
5.5.300.0000.04317.95
5.5.290.0030.05017.94
5.5.280.0030.04020.98
5.5.270.0030.04720.88
5.5.260.0170.07320.73
5.5.250.0170.03020.64
5.5.240.0070.07320.14
5.4.450.0330.07019.53
5.4.440.0300.06019.47
5.4.430.0370.06319.54
5.4.420.0230.04319.68
5.4.410.0330.03319.46
5.4.400.0400.06319.31
5.4.390.0400.06319.08
5.4.380.0470.05719.08
5.4.370.0430.06018.98
5.4.360.0300.04719.17
5.4.350.0300.03718.86
5.4.340.0330.07319.32
5.4.320.0300.05718.98
5.4.310.0270.04019.16
5.4.300.0330.06718.83
5.4.290.0330.07019.21
5.4.280.0330.03719.15
5.4.270.0270.07719.23
5.4.260.0270.04019.16
5.4.250.0270.05019.23
5.4.240.0330.03319.19
5.4.230.0370.06319.30
5.4.220.0330.07018.98
5.4.210.0430.06319.21
5.4.200.0400.05319.21
5.4.190.0430.04319.12
5.4.180.0230.04318.93
5.4.170.0270.05019.18
5.4.160.0400.04319.22
5.4.150.0400.06318.80
5.4.140.0330.07316.34
5.4.130.0400.06016.76
5.4.120.0400.04716.55
5.4.110.0430.04016.61
5.4.100.0370.03716.50
5.4.90.0270.04016.64
5.4.80.0300.07016.59
5.4.70.0370.04316.57
5.4.60.0330.03716.49
5.4.50.0370.06716.38
5.4.40.0300.03716.23
5.4.30.0270.04716.51
5.4.20.0400.04016.48
5.4.10.0330.04016.33
5.4.00.0300.03715.96
5.3.290.0400.06314.70
5.3.280.0270.04014.52
5.3.270.0430.06714.58
5.3.260.0300.05014.59
5.3.250.0530.04314.59
5.3.240.0370.06014.58
5.3.230.0270.07314.52
5.3.220.0400.07014.49
5.3.210.0330.06314.49
5.3.200.0330.07014.58
5.3.190.0230.04014.66
5.3.180.0330.04314.55
5.3.170.0270.04014.66
5.3.160.0370.06314.55
5.3.150.0430.06314.73
5.3.140.0370.06014.54
5.3.130.0330.05014.60
5.3.120.0300.07014.64
5.3.110.0400.07014.47
5.3.100.0330.04314.01
5.3.90.0400.04014.02
5.3.80.0470.06014.10
5.3.70.0370.06713.93
5.3.60.0400.06713.93
5.3.50.0430.04714.01
5.3.40.0300.07014.01
5.3.30.0270.04313.85
5.3.20.0330.05013.82
5.3.10.0370.02713.65
5.3.00.0270.04713.70
5.2.170.0230.03011.07
5.2.160.0270.05711.07
5.2.150.0270.05711.07
5.2.140.0200.03311.11
5.2.130.0270.04711.02
5.2.120.0270.02711.09
5.2.110.0330.05011.16
5.2.100.0230.03011.01
5.2.90.0270.02711.16
5.2.80.0230.03011.02
5.2.70.0300.05711.15
5.2.60.0230.05011.07
5.2.50.0300.04710.98
5.2.40.0270.02310.91
5.2.30.0300.05310.95
5.2.20.0230.03710.96
5.2.10.0170.03010.89
5.2.00.0170.05710.77
5.1.60.0300.03710.09
5.1.50.0230.0309.99
5.1.40.0300.0439.90
5.1.30.0200.02710.43
5.1.20.0200.02710.36
5.1.10.0230.03710.05
5.1.00.0230.02710.22
5.0.50.0170.0439.90
5.0.40.0200.0379.90
5.0.30.0130.0609.90
5.0.20.0100.0239.90
5.0.10.0130.0279.90
5.0.00.0130.0579.90
4.4.90.0130.0339.90
4.4.80.0200.0309.90
4.4.70.0130.0139.90
4.4.60.0100.0339.90
4.4.50.0100.0379.90
4.4.40.0100.0439.90
4.4.30.0130.0139.90
4.4.20.0170.0309.90
4.4.10.0130.0339.90
4.4.00.0100.0479.90
4.3.110.0100.0409.90
4.3.100.0070.0179.90
4.3.90.0130.0239.90
4.3.80.0100.0339.90
4.3.70.0170.0209.90
4.3.60.0100.0239.90
4.3.50.0130.0179.90
4.3.40.0070.0279.90
4.3.30.0070.0139.90
4.3.20.0070.0409.90
4.3.10.0030.0309.90
4.3.00.0100.0209.90

preferences:
29.17 ms | 401 KiB | 5 Q