3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "Cooking", "look", "I cant", "Walking the dog to the park", "washing", "talk", "one" ]; $maxLength = -1; $longestValue = null; foreach ($array as $value) { $length = strlen($value); if ($length > $maxLength) { $maxLength = $length; $longestValue = $value; } } var_export($longestValue);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 12
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 = 4
Branch analysis from position: 4
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/klOVj
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $maxLength, !2 = $longestValue, !3 = $value, !4 = $length
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, -1
   14     2        ASSIGN                                                   !2, null
   15     3      > FE_RESET_R                                       $8      !0, ->12
          4    > > FE_FETCH_R                                               $8, !3, ->12
   16     5    >   STRLEN                                           ~9      !3
          6        ASSIGN                                                   !4, ~9
   17     7        IS_SMALLER                                               !1, !4
          8      > JMPZ                                                     ~11, ->11
   18     9    >   ASSIGN                                                   !1, !4
   19    10        ASSIGN                                                   !2, !3
   15    11    > > JMP                                                      ->4
         12    >   FE_FREE                                                  $8
   22    13        INIT_FCALL                                               'var_export'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
258.4 ms | 1013 KiB | 15 Q