3v4l.org

run code in 300+ PHP versions simultaneously
<?php function set_name($name) { $GLOBALS['name'] = $name; } function get_name() { return $GLOBALS['name']; /* Above line is equal to: * global $name; * return $name; */ } function wrap($txt) { echo 'Your username is ' . get_name() . ' ' . $txt; } /* You should not print/echo stuff in a function. So the better way would be: * function wrap($txt) { * return 'Your username is ' . get_name() . $txt; * } * echo wrap($txt) */ // Usage: set_name('Rajitha'); wrap('tobacco');

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.0120.00316.25
8.3.60.0120.00918.40
8.3.50.0030.01122.12
8.3.40.0180.00418.84
8.3.30.0000.01419.04
8.3.20.0080.00020.19
8.3.10.0030.00523.48
8.3.00.0080.00020.52
8.2.190.0130.00918.29
8.2.180.0190.00316.38
8.2.170.0030.01022.96
8.2.160.0060.01022.08
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00226.16
8.2.120.0060.00319.77
8.2.110.0090.00022.12
8.2.100.0070.00417.91
8.2.90.0040.00419.21
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0000.00817.80
8.2.50.0090.00018.07
8.2.40.0000.00818.22
8.2.30.0040.00418.04
8.2.20.0000.00817.65
8.2.10.0050.00317.63
8.2.00.0040.00417.68
8.1.280.0120.00325.92
8.1.270.0060.00322.14
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0090.00023.96
8.1.230.0070.00319.00
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0000.00717.41
8.1.180.0050.00318.10
8.1.170.0040.00418.39
8.1.160.0070.00322.00
8.1.150.0000.00718.54
8.1.140.0040.00417.45
8.1.130.0030.00317.83
8.1.120.0000.00717.43
8.1.110.0050.00317.35
8.1.100.0000.00917.42
8.1.90.0000.00717.34
8.1.80.0040.00417.48
8.1.70.0000.00717.44
8.1.60.0060.00317.47
8.1.50.0030.00617.39
8.1.40.0050.00317.53
8.1.30.0000.00817.64
8.1.20.0040.00417.56
8.1.10.0040.00417.34
8.1.00.0050.00217.35
8.0.300.0070.00018.77
8.0.290.0040.00416.93
8.0.280.0000.00718.28
8.0.270.0030.00316.71
8.0.260.0060.00316.68
8.0.250.0000.00716.82
8.0.240.0030.00316.75
8.0.230.0000.00716.88
8.0.220.0000.00716.70
8.0.210.0040.00416.71
8.0.200.0030.00316.94
8.0.190.0080.00016.80
8.0.180.0030.00616.73
8.0.170.0030.00616.73
8.0.160.0000.00716.65
8.0.150.0040.00416.79
8.0.140.0050.00316.81
8.0.130.0060.00013.18
8.0.120.0050.00216.78
8.0.110.0050.00216.79
8.0.100.0070.00016.88
8.0.90.0040.00416.93
8.0.80.0120.01116.80
8.0.70.0000.00816.89
8.0.60.0050.00316.76
8.0.50.0030.00416.81
8.0.30.0110.00717.28
8.0.20.0070.01217.40
8.0.10.0050.00217.02
8.0.00.0090.00916.54
7.4.330.0050.00015.09
7.4.320.0000.00616.60
7.4.300.0000.00616.63
7.4.290.0070.00016.42
7.4.280.0000.00716.43
7.4.270.0040.00416.54
7.4.260.0030.00316.38
7.4.250.0070.00016.41
7.4.240.0020.00516.55
7.4.230.0040.00416.43
7.4.220.0200.00716.45
7.4.210.0060.00816.51
7.4.200.0040.00416.64
7.4.190.0000.00716.37
7.4.160.0130.00416.68
7.4.150.0100.00917.40
7.4.140.0110.00817.86
7.4.130.0100.00616.54
7.4.120.0090.00816.54
7.4.110.0060.01216.60
7.4.100.0100.01016.49
7.4.90.0110.00616.46
7.4.80.0100.00716.57
7.4.70.0090.01216.62
7.4.60.0140.00716.53
7.4.50.0000.00616.61
7.4.40.0030.01322.77
7.4.30.0060.01616.57
7.4.00.0030.01015.10
7.3.330.0000.00613.23
7.3.320.0000.00613.17
7.3.310.0030.00316.38
7.3.300.0050.00316.27
7.3.290.0040.01016.36
7.3.280.0080.01216.39
7.3.270.0060.01517.40
7.3.260.0060.01216.26
7.3.250.0120.00816.46
7.3.240.0130.00316.29
7.3.230.0120.00316.39
7.3.210.0110.00716.36
7.3.200.0150.00619.39
7.3.190.0140.00316.28
7.3.180.0100.00716.52
7.3.170.0040.01116.55
7.3.160.0060.00916.30
7.3.120.0040.01214.85
7.3.00.0070.00416.50
7.2.330.0100.00616.77
7.2.320.0180.00416.69
7.2.310.0070.01316.54
7.2.300.0100.00616.63
7.2.290.0120.00416.43
7.2.130.0030.01016.79
7.2.120.0060.00916.80
7.2.110.0030.00916.67
7.2.100.0080.00416.86
7.2.90.0070.00716.95
7.2.80.0070.00316.86
7.2.70.0040.01117.02
7.2.60.0030.00816.85
7.2.50.0100.00516.82
7.2.40.0030.00817.01
7.2.30.0030.00917.00
7.2.20.0030.01416.94
7.2.10.0040.00716.89
7.2.00.0060.01117.89
7.1.250.0060.00915.56
7.1.240.0090.00615.83
7.1.230.0050.00515.97
7.1.220.0040.00815.66
7.1.210.0050.00515.64
7.1.200.0060.00815.86
7.1.190.0060.00615.53
7.1.180.0030.00615.57
7.1.170.0030.00615.70
7.1.160.0070.00315.68
7.1.150.0060.00315.69
7.1.140.0040.00415.77
7.1.130.0000.01315.88
7.1.120.0050.00515.96
7.1.110.0060.00615.84
7.1.100.0070.00517.12
7.1.90.0090.00015.49
7.1.80.0080.00015.82
7.1.70.0070.00416.57
7.1.60.0090.00917.46
7.1.50.0030.01016.44
7.1.40.0100.00315.59
7.1.30.0050.00315.96
7.1.20.0040.00715.67
7.1.10.0030.01015.67
7.1.00.0020.04419.13
7.0.330.0000.01115.51
7.0.320.0090.00615.50
7.0.310.0000.01115.00
7.0.300.0000.00915.04
7.0.290.0070.00715.24
7.0.280.0000.01115.35
7.0.270.0030.00915.10
7.0.260.0040.00415.47
7.0.250.0060.00615.15
7.0.240.0040.00415.34
7.0.230.0030.00715.27
7.0.220.0030.00615.47
7.0.210.0030.00715.34
7.0.200.0060.00415.91
7.0.190.0040.00415.10
7.0.180.0080.00415.20
7.0.170.0030.01015.43
7.0.160.0050.00315.36
7.0.150.0060.00615.41
7.0.140.0030.04018.74
7.0.130.0060.00615.45
7.0.120.0060.00315.41
7.0.110.0460.03117.75
7.0.100.0340.03917.77
7.0.90.0270.03317.56
7.0.80.0310.04317.72
7.0.70.0360.04317.70
7.0.60.0330.04517.75
7.0.50.0410.03517.71
7.0.40.0090.03716.73
7.0.30.0050.04516.51
7.0.20.0030.04416.59
7.0.10.0050.02616.58
7.0.00.0020.04216.55
5.6.380.0090.00314.39
5.6.370.0000.01214.68
5.6.360.0030.01014.53
5.6.350.0080.00414.60
5.6.340.0080.00414.42
5.6.330.0060.00314.07
5.6.320.0060.00314.29
5.6.310.0100.00014.10
5.6.300.0070.00714.42
5.6.290.0060.00314.67
5.6.280.0030.05117.54
5.6.270.0030.00814.15
5.6.260.0130.03517.70
5.6.250.0050.04517.46
5.6.240.0060.04117.43
5.6.230.0090.03217.52
5.6.220.0130.04017.45
5.6.210.0070.04017.48
5.6.200.0080.04817.49
5.6.190.0070.04017.48
5.6.180.0060.04517.39
5.6.170.0110.04017.41
5.6.160.0030.04617.41
5.6.150.0070.03717.55
5.6.140.0050.04517.45
5.6.130.0050.02617.43
5.6.120.0120.03517.52
5.6.110.0020.02717.56
5.6.100.0070.04217.44
5.6.90.0050.03117.41
5.6.80.0050.03217.05
5.6.70.0020.04517.18
5.6.60.0130.03517.08
5.6.50.0090.03517.17
5.6.40.0030.03017.01
5.6.30.0030.04517.14
5.6.20.0020.04317.07
5.6.10.0020.04617.24
5.6.00.0070.03417.28
5.5.380.0070.04014.52
5.5.370.0050.04214.37
5.5.360.0100.02014.43
5.5.350.0080.03114.43
5.5.340.0110.03514.65
5.5.330.0080.04014.79
5.5.320.0080.04314.63
5.5.310.0030.04314.81
5.5.300.0040.04614.50
5.5.290.0100.02014.66
5.5.280.0060.02514.55
5.5.270.0020.03314.63
5.5.260.0040.03214.64
5.5.250.0080.03714.63
5.5.240.0020.04514.31
5.5.230.0050.04214.39
5.5.220.0030.04514.28
5.5.210.0050.03814.24
5.5.200.0080.04014.26
5.5.190.0110.03514.18
5.5.180.0020.04714.29
5.5.170.0040.00411.30
5.5.160.0070.02114.30
5.5.150.0050.04214.27
5.5.140.0080.03614.38
5.5.130.0030.04614.41
5.5.120.0030.02314.40
5.5.110.0060.02314.30
5.5.100.0050.03614.32
5.5.90.0030.02214.25
5.5.80.0070.03214.34
5.5.70.0030.02714.34
5.5.60.0020.02514.16
5.5.50.0080.01714.34
5.5.40.0030.01814.20
5.5.30.0030.02314.25
5.5.20.0020.02214.23
5.5.10.0070.04214.10
5.5.00.0110.03514.23
5.4.450.0110.03615.30
5.4.440.0080.04115.32
5.4.430.0020.02815.42
5.4.420.0050.02315.26
5.4.410.0100.03715.36
5.4.400.0090.04115.11
5.4.390.0070.03715.14
5.4.380.0130.03315.16
5.4.370.0060.03815.08
5.4.360.0070.04215.16
5.4.350.0080.03815.09
5.4.340.0030.04215.09
5.4.330.0080.00311.18
5.4.320.0030.04015.14
5.4.310.0090.03715.18
5.4.300.0070.04015.10
5.4.290.0050.03715.09
5.4.280.0050.02715.16
5.4.270.0050.02415.09
5.4.260.0080.03315.22
5.4.250.0040.04115.10
5.4.240.0050.03515.09
5.4.230.0030.02615.09
5.4.220.0050.03815.09
5.4.210.0080.03815.08
5.4.200.0060.04115.34
5.4.190.0110.03515.08
5.4.180.0050.02515.10
5.4.170.0040.04315.17
5.4.160.0070.03515.06
5.4.150.0030.04715.19
5.4.140.0050.03713.76
5.4.130.0040.02513.76
5.4.120.0100.03713.76
5.4.110.0040.03013.82
5.4.100.0030.04013.89
5.4.90.0060.03713.82
5.4.80.0100.01713.84
5.4.70.0040.03913.76
5.4.60.0120.03213.90
5.4.50.0070.04013.87
5.4.40.0090.03913.83
5.4.30.0020.04013.82
5.4.20.0070.03713.87
5.4.10.0120.03113.78
5.4.00.0030.03913.55
5.3.290.0020.03812.92
5.3.280.0030.04112.91
5.3.270.0110.03312.90
5.3.260.0050.03912.87
5.3.250.0100.03512.90
5.3.240.0020.03312.89
5.3.230.0030.03812.95
5.3.220.0050.04012.88
5.3.210.0040.04212.86
5.3.200.0040.04412.94
5.3.190.0050.03912.95
5.3.180.0050.02312.80
5.3.170.0030.03812.84
5.3.160.0050.03412.88
5.3.150.0050.04012.94
5.3.140.0060.03812.91
5.3.130.0060.02212.79
5.3.120.0030.03512.84
5.3.110.0070.03812.91
5.3.100.0100.03712.62
5.3.90.0070.03512.62
5.3.80.0040.03412.61
5.3.70.0020.03712.63
5.3.60.0050.03712.67
5.3.50.0020.04312.60
5.3.40.0020.04312.56
5.3.30.0110.03312.47
5.3.20.0020.04312.44
5.3.10.0010.04112.43
5.3.00.0070.03712.41
5.2.170.0050.03111.22
5.2.160.0020.03711.22
5.2.150.0050.03111.15
5.2.140.0130.02611.16
5.2.130.0040.02911.12
5.2.120.0050.02311.20
5.2.110.0090.02711.20
5.2.100.0050.02711.07
5.2.90.0030.03111.20
5.2.80.0030.03411.20
5.2.70.0030.03211.16
5.2.60.0050.03011.11
5.2.50.0070.02811.08
5.2.40.0030.03411.09
5.2.30.0030.02011.08
5.2.20.0000.02811.06
5.2.10.0020.02011.03
5.2.00.0070.02710.95
5.1.60.0020.02410.66
5.1.50.0050.02710.66
5.1.40.0010.01910.66
5.1.30.0070.02710.75
5.1.20.0050.02510.77
5.1.10.0030.03110.66
5.1.00.0040.03010.66
5.0.50.0030.02510.66
5.0.40.0030.02410.66
5.0.30.0010.03610.66
5.0.20.0030.01310.66
5.0.10.0000.01310.66
5.0.00.0000.02010.66
4.4.90.0050.01710.66
4.4.80.0040.01710.66
4.4.70.0030.01310.66
4.4.60.0000.01210.66
4.4.50.0020.01210.66
4.4.40.0020.03010.66
4.4.30.0000.01810.66
4.4.20.0020.01310.66
4.4.10.0050.01710.66
4.4.00.0000.02510.66
4.3.110.0000.01810.66
4.3.100.0000.01010.66
4.3.90.0000.01310.66
4.3.80.0020.01510.66
4.3.70.0020.00810.66
4.3.60.0000.01210.66
4.3.50.0000.01210.66
4.3.40.0030.02210.66
4.3.30.0020.00810.66
4.3.20.0000.01010.66
4.3.10.0020.01010.66
4.3.00.0030.00710.66

preferences:
46.24 ms | 401 KiB | 5 Q