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('efs'); 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.60.0100.01016.50
8.3.50.0160.00521.89
8.3.40.0150.00018.73
8.3.30.0140.00018.92
8.3.20.0070.00020.16
8.3.10.0040.00423.70
8.3.00.0090.00018.89
8.2.180.0110.01118.04
8.2.170.0140.00022.96
8.2.160.0000.01420.38
8.2.150.0030.00524.18
8.2.140.0090.00024.66
8.2.130.0070.01026.16
8.2.120.0040.00419.77
8.2.110.0000.01022.08
8.2.100.0090.00317.91
8.2.90.0040.00419.29
8.2.80.0090.00017.97
8.2.70.0030.00617.63
8.2.60.0040.00417.92
8.2.50.0040.00418.07
8.2.40.0070.00018.03
8.2.30.0040.00418.11
8.2.20.0040.00417.56
8.2.10.0000.00717.73
8.2.00.0080.00017.55
8.1.280.0130.00725.92
8.1.270.0040.00421.92
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00023.89
8.1.230.0050.00519.05
8.1.220.0060.00317.74
8.1.210.0000.00818.77
8.1.200.0040.00417.11
8.1.190.0050.00317.40
8.1.180.0000.00818.10
8.1.170.0050.00318.61
8.1.160.0050.00322.01
8.1.150.0040.00418.74
8.1.140.0070.00017.48
8.1.130.0000.00717.73
8.1.120.0030.00317.36
8.1.110.0000.00717.46
8.1.100.0080.00017.45
8.1.90.0070.00017.38
8.1.80.0080.00017.39
8.1.70.0040.00417.45
8.1.60.0040.00417.58
8.1.50.0050.00317.38
8.1.40.0040.00417.52
8.1.30.0040.00417.55
8.1.20.0000.00717.56
8.1.10.0040.00417.40
8.1.00.0070.00017.49
8.0.300.0000.00718.77
8.0.290.0000.00717.18
8.0.280.0080.00018.25
8.0.270.0070.00017.23
8.0.260.0030.00316.75
8.0.250.0030.00316.92
8.0.240.0000.00716.92
8.0.230.0030.00316.79
8.0.220.0000.00716.85
8.0.210.0030.00516.84
8.0.200.0030.00316.74
8.0.190.0030.00516.71
8.0.180.0030.00716.74
8.0.170.0040.00416.85
8.0.160.0000.00816.77
8.0.150.0040.00416.80
8.0.140.0040.00416.84
8.0.130.0060.00013.34
8.0.120.0000.00816.81
8.0.110.0040.00416.65
8.0.100.0040.00416.76
8.0.90.0000.00716.83
8.0.80.0150.00016.82
8.0.70.0020.00516.89
8.0.60.0050.00316.82
8.0.50.0000.00716.88
8.0.30.0080.01017.15
8.0.20.0060.01217.40
8.0.10.0040.00416.87
8.0.00.0100.01316.77
7.4.330.0050.00015.01
7.4.320.0030.00316.42
7.4.300.0000.00616.64
7.4.290.0030.00316.51
7.4.280.0000.00716.34
7.4.270.0040.00416.41
7.4.260.0030.00316.58
7.4.250.0030.00416.56
7.4.240.0030.00416.55
7.4.230.0000.00716.67
7.4.220.0070.01016.53
7.4.210.0090.00516.51
7.4.200.0070.00016.57
7.4.190.0060.00316.30
7.4.160.0170.00316.52
7.4.150.0070.01017.40
7.4.140.0080.00817.86
7.4.130.0090.00816.50
7.4.120.0120.00516.44
7.4.110.0040.01216.49
7.4.100.0090.01316.49
7.4.90.0100.00716.38
7.4.80.0070.01119.39
7.4.70.0070.01616.52
7.4.60.0100.00716.52
7.4.50.0030.00616.37
7.4.40.0050.00522.77
7.4.30.0070.01016.52
7.4.10.0030.01615.11
7.4.00.0080.00915.01
7.3.330.0000.00513.37
7.3.320.0000.00613.32
7.3.310.0050.00216.26
7.3.300.0060.00016.37
7.3.290.0130.00816.36
7.3.280.0090.01016.37
7.3.270.0120.00617.40
7.3.260.0030.01416.37
7.3.250.0050.01316.59
7.3.240.0110.00816.41
7.3.230.0100.01216.59
7.3.210.0110.01116.38
7.3.200.0120.00919.39
7.3.190.0100.00716.40
7.3.180.0060.00916.54
7.3.170.0060.01016.44
7.3.160.0100.00716.33
7.3.130.0060.01314.91
7.3.120.0030.01314.87
7.3.110.0080.00814.85
7.3.100.0110.00014.76
7.3.90.0070.00414.86
7.3.80.0030.00714.75
7.3.70.0060.00614.81
7.3.60.0040.00814.73
7.3.50.0030.00914.69
7.3.40.0060.00314.67
7.3.30.0070.00714.60
7.3.20.0070.00316.71
7.3.10.0050.00916.57
7.3.00.0090.00616.60
7.2.330.0100.00716.70
7.2.320.0120.01216.78
7.2.310.0030.01316.38
7.2.300.0000.01716.67
7.2.290.0060.00916.79
7.2.260.0120.00614.84
7.2.250.0030.01714.94
7.2.240.0060.00914.62
7.2.230.0100.00615.27
7.2.220.0060.01315.28
7.2.210.0000.01315.10
7.2.200.0070.00314.90
7.2.190.0070.01014.89
7.2.180.0000.01015.00
7.2.170.0070.00714.89
7.2.160.0060.00915.10
7.2.150.0040.01116.77
7.2.140.0100.00716.88
7.2.130.0050.00916.80
7.2.120.0060.00617.06
7.2.110.0100.00316.93
7.2.100.0020.01316.89
7.2.90.0090.00216.97
7.2.80.0050.01016.91
7.2.70.0070.00916.92
7.2.60.0080.00816.87
7.2.50.0050.00916.88
7.2.40.0090.00716.99
7.2.30.0050.00717.06
7.2.20.0020.01016.98
7.2.10.0060.00816.99
7.2.00.0030.01117.60
7.1.330.0070.00715.60
7.1.320.0130.00315.75
7.1.310.0030.01015.80
7.1.300.0030.01415.88
7.1.290.0000.01015.86
7.1.280.0000.01115.73
7.1.270.0030.00615.86
7.1.260.0060.00615.76
7.1.250.0020.01015.81
7.1.240.0110.00515.75
7.1.230.0020.01015.71
7.1.220.0110.00315.91
7.1.210.0050.00415.80
7.1.200.0030.00815.91
7.1.190.0070.00715.76
7.1.180.0040.00915.71
7.1.170.0050.00615.83
7.1.160.0050.00715.89
7.1.150.0050.00815.83
7.1.140.0020.01115.70
7.1.130.0020.00715.84
7.1.120.0060.00615.58
7.1.110.0080.00615.76
7.1.100.0050.00716.51
7.1.90.0090.00515.73
7.1.80.0020.00915.77
7.1.70.0010.01116.19
7.1.60.0060.01116.96
7.1.50.0030.01016.10
7.1.40.0070.00515.97
7.1.30.0050.00915.93
7.1.20.0080.00415.84
7.1.10.0060.00615.76
7.1.00.0040.03018.01
7.0.330.0030.00715.38
7.0.320.0100.00515.28
7.0.310.0040.00915.35
7.0.300.0040.01115.48
7.0.290.0020.00915.42
7.0.280.0020.00815.35
7.0.270.0030.00815.33
7.0.260.0080.00315.32
7.0.250.0060.00615.26
7.0.240.0030.00815.50
7.0.230.0020.00915.31
7.0.220.0030.00815.46
7.0.210.0040.00915.36
7.0.200.0030.00615.79
7.0.190.0040.00915.39
7.0.180.0050.00715.32
7.0.170.0060.00615.35
7.0.160.0070.00715.18
7.0.150.0090.00615.46
7.0.140.0040.02817.56
7.0.130.0050.01015.25
7.0.120.0050.00615.42
7.0.110.0040.00715.37
7.0.100.0070.02916.96
7.0.90.0170.01916.98
7.0.80.0060.03016.97
7.0.70.0070.02817.01
7.0.60.0100.01716.90
7.0.50.0060.03117.00
7.0.40.0040.02215.65
7.0.30.0030.02115.65
7.0.20.0040.02015.55
7.0.10.0020.02115.63
7.0.00.0050.01615.60
5.6.400.0070.00714.54
5.6.390.0000.01414.63
5.6.380.0050.00714.49
5.6.370.0080.00814.55
5.6.360.0060.00614.56
5.6.350.0030.01014.54
5.6.340.0090.00314.36
5.6.330.0070.00314.44
5.6.320.0060.00914.21
5.6.310.0110.00314.30
5.6.300.0060.00614.44
5.6.290.0040.00614.37
5.6.280.0090.02816.68
5.6.270.0060.00714.63
5.6.260.0030.00814.51
5.6.250.0080.02916.50
5.6.240.0060.03016.44
5.6.230.0100.02316.41
5.6.220.0060.03116.53
5.6.210.0080.02916.32
5.6.200.0060.03316.70
5.6.190.0100.02616.53
5.6.180.0040.01716.67
5.6.170.0040.02116.59
5.6.160.0020.02016.61
5.6.150.0040.02016.65
5.6.140.0030.02116.53
5.6.130.0040.02016.61
5.6.120.0040.01916.63
5.6.110.0070.01716.65
5.6.100.0050.02116.67
5.6.90.0050.01616.73
5.6.80.0060.01616.30
5.6.70.0040.01816.40
5.6.60.0060.01316.25
5.6.50.0030.01616.44
5.6.40.0080.01416.38
5.6.30.0020.02216.29
5.6.20.0030.01616.38
5.6.10.0070.01316.41
5.6.00.0030.01616.37
5.5.380.0150.02015.44
5.5.370.0040.02115.27
5.5.360.0020.03015.45
5.5.350.0050.02915.22
5.5.340.0060.02015.49
5.5.330.0030.01915.55
5.5.320.0060.01715.24
5.5.310.0100.01415.35
5.5.300.0050.01915.41
5.5.290.0040.01715.36
5.5.280.0040.01815.56
5.5.270.0070.01615.49
5.5.260.0060.01515.39
5.5.250.0040.01515.43
5.5.240.0060.01415.20
5.5.230.0080.01115.25
5.5.220.0040.02215.25
5.5.210.0010.02215.27
5.5.200.0020.01715.33
5.5.190.0060.01515.31
5.5.180.0030.01715.22
5.5.170.0080.00612.52
5.5.160.0080.01815.19
5.5.150.0040.01615.27
5.5.140.0040.01415.29
5.5.130.0090.01315.21
5.5.120.0030.01815.19
5.5.110.0020.01815.12
5.5.100.0050.02015.25
5.5.90.0060.02515.17
5.5.80.0050.01715.14
5.5.70.0050.02115.11
5.5.60.0050.03215.09
5.5.50.0070.03115.21
5.5.40.0080.02615.13
5.5.30.0050.03015.11
5.5.20.0040.03015.06
5.5.10.0030.01914.98
5.5.00.0060.02015.18
5.4.450.0060.01414.09
5.4.440.0060.01314.12
5.4.430.0050.01514.17
5.4.420.0040.01814.21
5.4.410.0010.01914.09
5.4.400.0040.01414.05
5.4.390.0070.01313.99
5.4.380.0030.01614.06
5.4.370.0020.01714.07
5.4.360.0050.01614.04
5.4.350.0030.01614.06
5.4.340.0040.01514.08
5.4.330.0020.00811.54
5.4.320.0020.01514.08
5.4.310.0040.01314.09
5.4.300.0030.01513.91
5.4.290.0030.01313.99
5.4.280.0050.01814.13
5.4.270.0010.01614.17
5.4.260.0030.01614.04
5.4.250.0060.01213.94
5.4.240.0030.01514.01
5.4.230.0040.02313.99
5.4.220.0030.02714.05
5.4.210.0060.02014.12
5.4.200.0090.02714.14
5.4.190.0050.03113.98
5.4.180.0070.01913.96
5.4.170.0060.02914.10
5.4.160.0090.02414.06
5.4.150.0050.03014.09
5.4.140.0090.01513.28
5.4.130.0070.02913.15
5.4.120.0060.02613.10
5.4.110.0040.01913.22
5.4.100.0030.02913.03
5.4.90.0110.02413.17
5.4.80.0080.02513.23
5.4.70.0060.02813.12
5.4.60.0090.02613.20
5.4.50.0040.02513.09
5.4.40.0080.02413.14
5.4.30.0080.02613.17
5.4.20.0060.02713.21
5.4.10.0060.02513.11
5.4.00.0040.02612.94
5.3.290.0040.01412.45
5.3.280.0030.01612.34
5.3.270.0010.03212.42
5.3.260.0050.02812.46
5.3.250.0060.02612.41
5.3.240.0040.01812.30
5.3.230.0060.02712.30
5.3.220.0050.02712.39
5.3.210.0050.02812.34
5.3.200.0010.03212.26
5.3.190.0070.02812.26
5.3.180.0050.02312.45
5.3.170.0050.02712.41
5.3.160.0060.02612.41
5.3.150.0060.02812.31
5.3.140.0050.03012.42
5.3.130.0060.02812.39
5.3.120.0070.02612.47
5.3.110.0090.02612.46
5.3.100.0070.01812.25
5.3.90.0060.01912.20
5.3.80.0090.02212.06
5.3.70.0060.02912.21
5.3.60.0040.03012.13
5.3.50.0020.02912.16
5.3.40.0050.01812.19
5.3.30.0030.03012.19
5.3.20.0080.02412.03
5.3.10.0070.02411.99
5.3.00.0020.02411.96
5.2.170.0020.03510.94
5.2.160.0050.03310.88
5.2.150.0060.03310.87
5.2.140.0080.03010.73
5.2.130.0050.03110.90
5.2.120.0080.02810.88
5.2.110.0050.03210.87
5.2.100.0110.02810.72
5.2.90.0040.02410.69
5.2.80.0040.03410.83
5.2.70.0030.03510.72
5.2.60.0060.03310.76
5.2.50.0050.03710.81
5.2.40.0050.03110.83
5.2.30.0020.03710.73
5.2.20.0000.03410.77
5.2.10.0030.03310.61
5.2.00.0070.03210.60
5.1.60.0030.02810.60
5.1.50.0050.03110.60
5.1.40.0050.02910.60
5.1.30.0000.03110.60
5.1.20.0040.02710.60
5.1.10.0080.02210.60
5.1.00.0030.03110.60
5.0.50.0030.02610.60
5.0.40.0030.01810.60
5.0.30.0040.02510.60
5.0.20.0030.02310.60
5.0.10.0060.01510.60
5.0.00.0030.02910.60
4.4.90.0020.02110.60
4.4.80.0030.01810.60
4.4.70.0030.02010.60
4.4.60.0000.02110.60
4.4.50.0000.02210.60
4.4.40.0070.02510.60
4.4.30.0020.02310.60
4.4.20.0030.01610.60
4.4.10.0020.01610.60
4.4.00.0060.02510.60
4.3.110.0000.02110.60
4.3.100.0000.02110.60
4.3.90.0050.01610.60
4.3.80.0020.02710.60
4.3.70.0000.02210.60
4.3.60.0020.01810.60
4.3.50.0050.01210.60
4.3.40.0040.02810.60
4.3.30.0020.01910.60
4.3.20.0030.01210.60
4.3.10.0050.01710.60
4.3.00.0050.01710.60

preferences:
39.81 ms | 400 KiB | 5 Q