3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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_arg(0)); } function _for() { foreach (func_get_arg(0) as $__k => $__v) { $$__k = $__v; } unset($__k, $__v); } $t = -microtime(TRUE); _ext($vars); echo sprintf('%.4f', $t + microtime(TRUE)) . PHP_EOL; $t = -microtime(TRUE); _for($vars); echo sprintf('%.4f', $t + microtime(TRUE)) . PHP_EOL;
Output for 7.1.0
0.0033 0.0085
Output for 7.0.14
0.0036 0.0083
Output for 7.0.12
0.0037 0.0085
Output for 7.0.6
0.0039 0.0103
Output for 7.0.5
0.0034 0.0093
Output for 7.0.4
0.0035 0.0106
Output for 7.0.3
0.0030 0.0095
Output for 7.0.2
0.0032 0.0098
Output for 7.0.1
0.0036 0.0106
Output for 7.0.0
0.0038 0.0102
Output for hhvm-3.12.0
0.0052 0.0337
Output for hhvm-3.10.0
0.0055 0.1121
Output for 5.6.28
0.0230 0.0352
Output for 5.6.21
0.0285 0.0409
Output for 5.6.20
0.0266 0.0396
Output for 5.6.18 - 5.6.19
0.0263 0.0394
Output for 5.6.17
0.0247 0.0381
Output for 5.6.16
0.0245 0.0393
Output for 5.6.15
0.0244 0.0373
Output for 5.6.14
0.0250 0.0381
Output for 5.6.13
0.0249 0.0388
Output for 5.6.11 - 5.6.12
0.0251 0.0386
Output for 5.6.10
0.0249 0.0383
Output for 5.6.9
0.0249 0.0380
Output for 5.6.8
0.0249 0.0384
Output for 5.6.7
0.0251 0.0379
Output for 5.6.6
0.0250 0.0371
Output for 5.6.5
0.0255 0.0372
Output for 5.6.4
0.0248 0.0384
Output for 5.6.3
0.0282 0.0509
Output for 5.6.2
0.0238 0.0366
Output for 5.6.1
0.0227 0.0342
Output for 5.6.0
0.0230 0.0343
Output for 5.5.35
0.0350 0.0325
Output for 5.5.34
0.0395 0.0381
Output for 5.5.33
0.0393 0.0387
Output for 5.5.32
0.0394 0.0384
Output for 5.5.31
0.0400 0.0383
Output for 5.5.30
0.0397 0.0383
Output for 5.5.29
0.0394 0.0381
Output for 5.4.0, 5.5.28
0.0400 0.0385
Output for 5.4.3, 5.5.27
0.0401 0.0384
Output for 5.5.26
0.0405 0.0399
Output for 5.5.25
0.0402 0.0392
Output for 5.5.24
0.0400 0.0397
Output for 5.5.21, 5.5.23
0.0399 0.0387
Output for 5.5.22
0.0398 0.0396
Output for 5.5.20
0.0399 0.0386
Output for 5.5.19
0.0358 0.0355
Output for 5.5.18
0.0365 0.0351
Output for 5.5.16
0.0362 0.0357
Output for 5.5.15
0.0391 0.0376
Output for 5.5.14
0.0404 0.0383
Output for 5.5.13
0.0366 0.0371
Output for 5.4.20, 5.5.12
0.0362 0.0364
Output for 5.5.11
0.0420 0.0403
Output for 5.5.10
0.0362 0.0352
Output for 5.5.9
0.0368 0.0352
Output for 5.5.8
0.0364 0.0357
Output for 5.5.7
0.0360 0.0360
Output for 5.5.6
0.0408 0.0420
Output for 5.5.5
0.0358 0.0345
Output for 5.5.4
0.0385 0.0355
Output for 5.5.3
0.0441 0.0402
Output for 5.5.2
0.0444 0.0403
Output for 5.5.1
0.0437 0.0413
Output for 5.5.0
0.0406 0.0396
Output for 5.4.45
0.0387 0.0389
Output for 5.4.44
0.0413 0.0424
Output for 5.4.43
0.0400 0.0399
Output for 5.4.42
0.0396 0.0394
Output for 5.4.41
0.0402 0.0397
Output for 5.4.40
0.0451 0.0403
Output for 5.4.39
0.0435 0.0407
Output for 5.4.36, 5.4.38
0.0438 0.0405
Output for 5.4.37
0.0443 0.0416
Output for 5.4.35
0.0438 0.0410
Output for 5.4.34
0.0406 0.0368
Output for 5.4.32
0.0394 0.0371
Output for 5.4.31
0.0398 0.0369
Output for 5.4.22, 5.4.30
0.0376 0.0371
Output for 5.4.29
0.0358 0.0373
Output for 5.4.28
0.0362 0.0367
Output for 5.4.27
0.0357 0.0360
Output for 5.4.26
0.0472 0.0514
Output for 5.4.25
0.0360 0.0346
Output for 5.4.24
0.0358 0.0363
Output for 5.4.23
0.0357 0.0359
Output for 5.4.21
0.0352 0.0357
Output for 5.4.19
0.0394 0.0392
Output for 5.4.18
0.0402 0.0396
Output for 5.4.17
0.0418 0.0423
Output for 5.4.16
0.0396 0.0398
Output for 5.4.15
0.0397 0.0393
Output for 5.4.14
0.0394 0.0382
Output for 5.4.13
0.0418 0.0407
Output for 5.4.12
0.0397 0.0388
Output for 5.4.11
0.0376 0.0369
Output for 5.4.10
0.0364 0.0356
Output for 5.4.9
0.0366 0.0365
Output for 5.4.8
0.0451 0.0408
Output for 5.4.7
0.0444 0.0402
Output for 5.4.6
0.0405 0.0378
Output for 5.4.5
0.0402 0.0395
Output for 5.4.4
0.0437 0.0417
Output for 5.4.2
0.0405 0.0376
Output for 5.4.1
0.0397 0.0385
Output for 5.3.29
0.0378 0.0378
Output for 5.3.28
0.0406 0.0401
Output for 5.3.27
0.0399 0.0384
Output for 5.3.26
0.0392 0.0397
Output for 5.3.25
0.0388 0.0398
Output for 5.3.24
0.0384 0.0397
Output for 5.3.23
0.0389 0.0401
Output for 5.3.22
0.0352 0.0356
Output for 5.3.21
0.0379 0.0404
Output for 5.3.20
0.0351 0.0368
Output for 5.3.19
0.0344 0.0362
Output for 5.3.18
0.0348 0.0373
Output for 5.3.17
0.0389 0.0396
Output for 5.3.16
0.0390 0.0410
Output for 5.3.15
0.0389 0.0408
Output for 5.3.14
0.0384 0.0413
Output for 5.3.13
0.0385 0.0420
Output for 5.3.12
0.0385 0.0422
Output for 5.3.11
0.0384 0.0414
Output for 5.3.10
0.0394 0.0419
Output for 5.3.9
0.0396 0.0400
Output for 5.3.8
0.0398 0.0403
Output for 5.3.7
0.0447 0.0474
Output for 5.3.6
0.0441 0.0416
Output for 5.3.5
0.0403 0.0421
Output for 5.3.4
0.0403 0.0413
Output for 5.3.3
0.0386 0.0384
Output for 5.3.2
0.0447 0.0435
Output for 5.3.1
0.0398 0.0412
Output for 5.3.0
0.0402 0.0417
Output for 5.2.3 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /in/Yr5PN on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.2
<br /> <b>Parse error</b>: syntax error, unexpected T_FUNCTION, expecting ')' in <b>/in/Yr5PN</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
<br /> <b>Parse error</b>: parse error, unexpected T_FUNCTION, expecting ')' in <b>/in/Yr5PN</b> on line <b>3</b><br />
Process exited with code 255.
Output for 4.3.2 - 4.3.4
<br /> <b>Parse error</b>: parse error, expecting `')'' in <b>/in/Yr5PN</b> on line <b>3</b><br />
Process exited with code 255.