3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array('green', 'blue', 'cyan1'); // blue cyan1 green $arr2 = array('yellow', 'red', 'cyan2'); // cyan2 red yellow $i = 1; function print_elements($e1, $e2) { global $i; $r = substr($e1, 0, 4) <=> substr($e2, 0, 4); echo "$i. $e1 <=> $e2 == $r\n"; $i++; return $r; } print_r(array_uintersect($arr1, $arr2, 'print_elements'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SgodV
function name:  (null)
number of ops:  12
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, 1
   15     3        INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'array_uintersect'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 'print_elements'
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function print_elements:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/SgodV
function name:  print_elements
number of ops:  27
compiled vars:  !0 = $e1, !1 = $e2, !2 = $i, !3 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    8     2        BIND_GLOBAL                                              !2, 'i'
    9     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 0
          6        SEND_VAL                                                 4
          7        DO_ICALL                                         $4      
          8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !1
         10        SEND_VAL                                                 0
         11        SEND_VAL                                                 4
         12        DO_ICALL                                         $5      
         13        SPACESHIP                                        ~6      $4, $5
         14        ASSIGN                                                   !3, ~6
   10    15        ROPE_INIT                                     8  ~9      !2
         16        ROPE_ADD                                      1  ~9      ~9, '.+'
         17        ROPE_ADD                                      2  ~9      ~9, !0
         18        ROPE_ADD                                      3  ~9      ~9, '+%3C%3D%3E+'
         19        ROPE_ADD                                      4  ~9      ~9, !1
         20        ROPE_ADD                                      5  ~9      ~9, '+%3D%3D+'
         21        ROPE_ADD                                      6  ~9      ~9, !3
         22        ROPE_END                                      7  ~8      ~9, '%0A'
         23        ECHO                                                     ~8
   11    24        PRE_INC                                                  !2
   12    25      > RETURN                                                   !3
   13    26*     > RETURN                                                   null

End of function print_elements

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.52 ms | 1396 KiB | 19 Q