3v4l.org

run code in 300+ PHP versions simultaneously
<?php $telefones = [ '(11) 3333-4353', '(11) 98000-2222', '(11) 3027-5555', '(11) 97000-0333', '(12) 99999-9999', '(12) 88888-8888', '(13) 11111-1111' ]; $inicio = microtime(true); function sortNumber($a, $b) { $a = preg_replace('/\D/', '', $a); $b = preg_replace('/\D/', '', $b); return ($a > $b) ? -1 : 1; } for($i = 0; $i < 50000; $i++){ usort($telefones, 'sortNumber'); } echo 'Bruno Rigolon:' . (microtime(true) - $inicio) . "\n";

Abusive script

This script was stopped while abusing our resources

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)
7.1.60.0900.38033.38
7.1.50.0630.46733.05
7.1.40.0200.51732.86
7.1.30.1170.58732.77
7.1.20.1030.53332.93
7.1.10.0470.56714.80
7.1.00.1300.69014.92
7.0.200.0570.52015.00
7.0.190.1170.53014.73
7.0.180.0730.41314.52
7.0.170.0600.48014.45
7.0.160.0770.66014.75
7.0.150.0500.40714.70
7.0.140.0470.39014.69
7.0.130.0600.66314.71
7.0.120.1000.67314.73
7.0.110.0070.49714.60
7.0.100.0700.55314.66
7.0.90.0300.68014.72
7.0.80.0830.71714.56
7.0.70.0770.50714.48
7.0.60.0670.50314.59
7.0.50.0400.64314.70
7.0.40.0700.49714.55
7.0.30.0530.35014.90
7.0.20.1170.47014.74
7.0.10.0530.58314.71
7.0.00.0830.50714.75

preferences:
13.8 ms | 403 KiB | 5 Q