3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GetLongestString() { $args = func_get_args(); $longestString = ""; foreach($args as $str) { $longestString = strlen($str) > strlen($longestString) ? $str : $longestString; } return strlen($longestString); } echo GetLongestString("a", "ab", "abc"); var_dump(explode('@', "hello@bye"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QRIoY
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'getlongeststring'
          1        SEND_VAL                                                 'a'
          2        SEND_VAL                                                 'ab'
          3        SEND_VAL                                                 'abc'
          4        DO_FCALL                                      0  $0      
          5        ECHO                                                     $0
   14     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '%40'
          9        SEND_VAL                                                 'hello%40bye'
         10        DO_ICALL                                         $1      
         11        SEND_VAR                                                 $1
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function getlongeststring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 14
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/QRIoY
function name:  GetLongestString
number of ops:  18
compiled vars:  !0 = $args, !1 = $longestString, !2 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FUNC_GET_ARGS                                    ~3      
          1        ASSIGN                                                   !0, ~3
    5     2        ASSIGN                                                   !1, ''
    6     3      > FE_RESET_R                                       $6      !0, ->14
          4    > > FE_FETCH_R                                               $6, !2, ->14
    7     5    >   STRLEN                                           ~7      !2
          6        STRLEN                                           ~8      !1
          7        IS_SMALLER                                               ~8, ~7
          8      > JMPZ                                                     ~9, ->11
          9    >   QM_ASSIGN                                        ~10     !2
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~10     !1
         12    >   ASSIGN                                                   !1, ~10
    6    13      > JMP                                                      ->4
         14    >   FE_FREE                                                  $6
    9    15        STRLEN                                           ~12     !1
         16      > RETURN                                                   ~12
   10    17*     > RETURN                                                   null

End of function getlongeststring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.1 ms | 1399 KiB | 18 Q