3v4l.org

run code in 300+ PHP versions simultaneously
<?php function GetLongestString() { $args = func_get_args(); $max = 0; $str = ""; foreach($args as $arg) { $len = strlen($arg); if($len > $max) { $max= $len; } } return $max; } print GetLongestString("a", "bcd", "efgh", "ij", "") ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Cqci
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'getlongeststring'
          1        SEND_VAL                                                 'a'
          2        SEND_VAL                                                 'bcd'
          3        SEND_VAL                                                 'efgh'
          4        SEND_VAL                                                 'ij'
          5        SEND_VAL                                                 ''
          6        DO_FCALL                                      0  $0      
          7        ECHO                                                     $0
          8      > RETURN                                                   1

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

End of function getlongeststring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.81 ms | 1403 KiB | 14 Q