3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array( 'Google', 'Facebook', 'Twitter', 'Slack', 'Twilio', ); $r = null; array_walk($array, function($v, $k) use (&$r){ $r[$v] = strlen($v); }); echo array_search(max($r), $r);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ETf9F
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array, !1 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   10     1        ASSIGN                                                       !1, null
   11     2        INIT_FCALL                                                   'array_walk'
          3        SEND_REF                                                     !0
          4        DECLARE_LAMBDA_FUNCTION                              ~4      [0]
          5        BIND_LEXICAL                                                 ~4, !1
   13     6        SEND_VAL                                                     ~4
   11     7        DO_ICALL                                                     
   14     8        INIT_FCALL                                                   'array_search'
          9        INIT_FCALL                                                   'max'
         10        SEND_VAR                                                     !1
         11        DO_ICALL                                             $6      
         12        SEND_VAR                                                     $6
         13        SEND_VAR                                                     !1
         14        DO_ICALL                                             $7      
         15        ECHO                                                         $7
         16      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ETf9F
function name:  {closure:/in/ETf9F:11}
number of ops:  7
compiled vars:  !0 = $v, !1 = $k, !2 = $r
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   12     3        STRLEN                                               ~4      !0
          4        ASSIGN_DIM                                                   !2, !0
          5        OP_DATA                                                      ~4
   13     6      > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.67 ms | 3274 KiB | 16 Q