3v4l.org

run code in 300+ PHP versions simultaneously
<?php function compare($a, $b) { $ret = value_compare_func($a, $b); echo "value_compare_func($a, $b) == $ret\n"; return $ret; } function value_compare_func($a, $b){ if ($a === 'n_3') { return 0; } return strcmp($a, $b); } $array1 = array("n_1", "n_2", "n_3", "n_4" ); $array2 = array("green"); $result = array_udiff($array1, $array2, "compare"); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GMgSB
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array1, !1 = $array2, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, <array>
   16     1        ASSIGN                                                   !1, <array>
   17     2        INIT_FCALL                                               'array_udiff'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 'compare'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !2, $5
   18     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function compare:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GMgSB
function name:  compare
number of ops:  17
compiled vars:  !0 = $a, !1 = $b, !2 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL_BY_NAME                                       'value_compare_func'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !2, $3
    5     7        ROPE_INIT                                     7  ~6      'value_compare_func%28'
          8        ROPE_ADD                                      1  ~6      ~6, !0
          9        ROPE_ADD                                      2  ~6      ~6, '%2C+'
         10        ROPE_ADD                                      3  ~6      ~6, !1
         11        ROPE_ADD                                      4  ~6      ~6, '%29+%3D%3D+'
         12        ROPE_ADD                                      5  ~6      ~6, !2
         13        ROPE_END                                      6  ~5      ~6, '%0A'
         14        ECHO                                                     ~5
    6    15      > RETURN                                                   !2
    7    16*     > RETURN                                                   null

End of function compare

Function value_compare_func:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 5
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GMgSB
function name:  value_compare_func
number of ops:  11
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        IS_IDENTICAL                                             !0, 'n_3'
          3      > JMPZ                                                     ~2, ->5
   11     4    > > RETURN                                                   0
   13     5    >   INIT_FCALL                                               'strcmp'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $3      
          9      > RETURN                                                   $3
   14    10*     > RETURN                                                   null

End of function value_compare_func

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.03 ms | 1400 KiB | 19 Q