3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = range(0, 100000); $keys = array_map(function ($x) { return chr(46+rand(0, 26)) . chr(46+rand(0, 26)) . chr(46+rand(0, 26)) . $x; }, $x); $vars = array_combine($keys, $x); function _ext() { extract(func_get_args(0)); } function _for() { foreach (func_get_args(0) as $__k => $__v) { $$__k = $__v; } unset($__k, $__v); } $t = -microtime(TRUE); _ext($vars); echo sprintf("%.4f", $t + microtime(TRUE)); $t = -microtime(TRUE); _for($vars); echo sprintf("%.4f", $t + microtime(TRUE));
Output for 5.5.6 - 5.5.7, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
0.00000.0000
Output for 5.5.36
0.01460.0122
Output for 5.5.35
0.01490.0129
Output for 5.5.34
0.01450.0123
Output for 5.3.27, 5.5.33
0.01470.0123
Output for 5.5.32
0.01490.0126
Output for 5.5.29, 5.5.31
0.01420.0125
Output for 5.4.23, 5.5.30
0.01440.0124
Output for 5.5.28
0.01220.0110
Output for 5.5.27
0.01440.0128
Output for 5.5.26
0.01420.0126
Output for 5.5.25
0.01450.0129
Output for 5.4.21, 5.4.44, 5.5.24
0.01400.0124
Output for 5.5.12, 5.5.19, 5.5.23
0.01410.0124
Output for 5.4.16, 5.4.19, 5.5.22
0.01410.0125
Output for 5.5.21
0.01480.0135
Output for 5.5.20
0.01460.0123
Output for 5.5.18
0.01400.0122
Output for 5.5.16
0.01390.0123
Output for 5.5.15
0.01230.0103
Output for 5.5.14
0.01450.0128
Output for 5.4.22, 5.4.41, 5.5.11, 5.5.13
0.01410.0123
Output for 5.5.10
0.01430.0126
Output for 5.5.9
0.01440.0123
Output for 5.4.12, 5.4.26, 5.4.45, 5.5.8
0.01400.0123
Output for 5.5.5
0.01390.0124
Output for 5.5.4
0.01390.0122
Output for 5.5.3
0.01570.0137
Output for 5.5.2
0.01620.0141
Output for 5.5.1
0.01690.0148
Output for 5.4.1, 5.5.0
0.01580.0141
Output for 5.4.43
0.01310.0116
Output for 5.4.42
0.01410.0126
Output for 5.4.40
0.01580.0134
Output for 5.4.39
0.01560.0137
Output for 5.4.38
0.01610.0136
Output for 5.4.37
0.01570.0136
Output for 5.4.36
0.01550.0136
Output for 5.4.31, 5.4.35
0.01580.0136
Output for 5.4.34
0.01580.0139
Output for 5.4.32
0.01570.0135
Output for 5.4.30
0.01450.0120
Output for 5.4.29
0.01430.0129
Output for 5.4.28
0.01450.0127
Output for 5.4.27
0.01370.0120
Output for 5.4.25
0.01390.0120
Output for 5.3.0, 5.4.24
0.01430.0120
Output for 5.4.20
0.01500.0133
Output for 5.4.18
0.01430.0124
Output for 5.4.17
0.01530.0122
Output for 5.4.15
0.01390.0126
Output for 5.4.14
0.01910.0166
Output for 5.4.13
0.01510.0130
Output for 5.4.11
0.01480.0131
Output for 5.4.10
0.01520.0135
Output for 5.4.9
0.01280.0115
Output for 5.4.8
0.01490.0125
Output for 5.4.7
0.01540.0128
Output for 5.4.6
0.01260.0119
Output for 5.4.5
0.01380.0136
Output for 5.4.4
0.01460.0126
Output for 5.4.3
0.01280.0114
Output for 5.4.2
0.01530.0112
Output for 5.4.0
0.01510.0139
Output for 5.3.29
0.01530.0131
Output for 5.3.28
0.01550.0133
Output for 5.3.26
0.01360.0115
Output for 5.3.20, 5.3.25
0.01370.0118
Output for 5.3.24
0.01410.0116
Output for 5.3.23
0.01400.0117
Output for 5.3.22
0.01380.0122
Output for 5.3.21
0.01350.0116
Output for 5.3.19
0.01390.0119
Output for 5.3.18
0.01490.0127
Output for 5.3.17
0.01390.0111
Output for 5.3.16
0.01350.0113
Output for 5.3.15
0.01250.0111
Output for 5.3.14
0.01530.0144
Output for 5.3.13
0.01250.0109
Output for 5.3.12
0.01220.0107
Output for 5.3.11
0.01260.0115
Output for 5.3.10
0.01170.0101
Output for 5.3.9
0.01290.0110
Output for 5.3.8
0.01230.0111
Output for 5.3.7
0.01240.0107
Output for 5.3.6
0.01470.0125
Output for 5.3.5
0.01530.0146
Output for 5.3.4
0.01510.0140
Output for 5.3.3
0.01250.0105
Output for 5.3.2
0.01420.0121
Output for 5.3.1
0.01310.0115
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/e0e81 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION, expecting ')' in /in/e0e81 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/e0e81 on line 3
Process exited with code 255.

preferences:
62 ms | 540 KiB | 5 Q