3v4l.org

run code in 300+ PHP versions simultaneously
<?php function length(string $str): int { return 0; } $data = ['hello', 'world']; usort($data, 'length'); // works usort($data, 'strlen'); // does not work
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SRPnb
function name:  (null)
number of ops:  10
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, <array>
   11     1        INIT_FCALL                                               'usort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 'length'
          4        DO_ICALL                                                 
   13     5        INIT_FCALL                                               'usort'
          6        SEND_REF                                                 !0
          7        SEND_VAL                                                 'strlen'
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function length:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SRPnb
function name:  length
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1      > RETURN                                                   0
    5     2*       VERIFY_RETURN_TYPE                                       
          3*     > RETURN                                                   null

End of function length

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.46 ms | 1399 KiB | 15 Q