3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GetLongestString() { $arr = func_get_args(); usort($arr, function($a, $b) { return strlen($b)-strlen($a); }); return strlen($arr[0]); } var_dump(GetLongestString("a", "aaa", "aa"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N453Z
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'getlongeststring'
          2        SEND_VAL                                                 'a'
          3        SEND_VAL                                                 'aaa'
          4        SEND_VAL                                                 'aa'
          5        DO_FCALL                                      0  $0      
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function getlongeststring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N453Z
function name:  GetLongestString
number of ops:  11
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FUNC_GET_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
    5     2        INIT_FCALL                                               'usort'
          3        SEND_REF                                                 !0
          4        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FN453Z%3A5%240'
    7     5        SEND_VAL                                                 ~3
          6        DO_ICALL                                                 
    8     7        FETCH_DIM_R                                      ~5      !0, 0
          8        STRLEN                                           ~6      ~5
          9      > RETURN                                                   ~6
    9    10*     > RETURN                                                   null

End of function getlongeststring

Function %00%7Bclosure%7D%2Fin%2FN453Z%3A5%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N453Z
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        STRLEN                                           ~2      !1
          3        STRLEN                                           ~3      !0
          4        SUB                                              ~4      ~2, ~3
          5      > RETURN                                                   ~4
    7     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FN453Z%3A5%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
190.96 ms | 1398 KiB | 18 Q