3v4l.org

run code in 500+ 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

Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 7
Branch analysis from position: 14
Branch analysis from position: 7
filename:       /in/PBLUX
function name:  (null)
number of ops:  22
compiled vars:  !0 = $telefones, !1 = $inicio, !2 = $i
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   15     1        INIT_FCALL                                                   'microtime'
          2        SEND_VAL                                                     <true>
          3        DO_ICALL                                             $4      
          4        ASSIGN                                                       !1, $4
   23     5        ASSIGN                                                       !2, 0
          6      > JMP                                                          ->12
   24     7    >   INIT_FCALL                                                   'usort'
          8        SEND_REF                                                     !0
          9        SEND_VAL                                                     'sortNumber'
         10        DO_ICALL                                                     
   23    11        PRE_INC                                                      !2
         12    >   IS_SMALLER                                                   !2, 50000
         13      > JMPNZ                                                        ~9, ->7
   28    14    >   INIT_FCALL                                                   'microtime'
         15        SEND_VAL                                                     <true>
         16        DO_ICALL                                             $10     
         17        SUB                                                  ~11     $10, !1
         18        CONCAT                                               ~12     'Bruno+Rigolon%3A', ~11
         19        CONCAT                                               ~13     ~12, '%0A'
         20        ECHO                                                         ~13
         21      > RETURN                                                       1

Function sortnumber:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PBLUX
function name:  sortNumber
number of ops:  15
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   18     2        FRAMELESS_ICALL_3                preg_replace        ~2      '%2F%5CD%2F', ''
          3        OP_DATA                                                      !0
          4        ASSIGN                                                       !0, ~2
   19     5        FRAMELESS_ICALL_3                preg_replace        ~4      '%2F%5CD%2F', ''
          6        OP_DATA                                                      !1
          7        ASSIGN                                                       !1, ~4
   20     8        IS_SMALLER                                                   !1, !0
          9      > JMPZ                                                         ~6, ->12
         10    >   QM_ASSIGN                                            ~7      -1
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~7      1
         13    > > RETURN                                                       ~7
   21    14*     > RETURN                                                       null

End of function sortnumber

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.91 ms | 1208 KiB | 15 Q