3v4l.org

run code in 300+ PHP versions simultaneously
<?php class cr { private $priv_member; function cr($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { if ($a->priv_member === $b->priv_member) return 0; return ($a->priv_member > $b->priv_member)? 1:-1; } } $a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),); $b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr(3), 1=> new cr(4), 2 => new cr(-15),); $result = array_udiff_assoc($a, $b, array("cr", "comp_func_cr")); print_r($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kTqsY
function name:  (null)
number of ops:  52
compiled vars:  !0 = $a, !1 = $b, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   NEW                                              $3      'cr'
          1        SEND_VAL_EX                                              9
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~5      $3, '0.1'
          4        NEW                                              $6      'cr'
          5        SEND_VAL_EX                                              12
          6        DO_FCALL                                      0          
          7        ADD_ARRAY_ELEMENT                                ~5      $6, '0.5'
          8        NEW                                              $8      'cr'
          9        SEND_VAL_EX                                              23
         10        DO_FCALL                                      0          
         11        ADD_ARRAY_ELEMENT                                ~5      $8, 0
         12        NEW                                              $10     'cr'
         13        SEND_VAL_EX                                              4
         14        DO_FCALL                                      0          
         15        ADD_ARRAY_ELEMENT                                ~5      $10, 1
         16        NEW                                              $12     'cr'
         17        SEND_VAL_EX                                              -15
         18        DO_FCALL                                      0          
         19        ADD_ARRAY_ELEMENT                                ~5      $12, 2
         20        ASSIGN                                                   !0, ~5
   17    21        NEW                                              $15     'cr'
         22        SEND_VAL_EX                                              9
         23        DO_FCALL                                      0          
         24        INIT_ARRAY                                       ~17     $15, '0.2'
         25        NEW                                              $18     'cr'
         26        SEND_VAL_EX                                              22
         27        DO_FCALL                                      0          
         28        ADD_ARRAY_ELEMENT                                ~17     $18, '0.5'
         29        NEW                                              $20     'cr'
         30        SEND_VAL_EX                                              3
         31        DO_FCALL                                      0          
         32        ADD_ARRAY_ELEMENT                                ~17     $20, 0
         33        NEW                                              $22     'cr'
         34        SEND_VAL_EX                                              4
         35        DO_FCALL                                      0          
         36        ADD_ARRAY_ELEMENT                                ~17     $22, 1
         37        NEW                                              $24     'cr'
         38        SEND_VAL_EX                                              -15
         39        DO_FCALL                                      0          
         40        ADD_ARRAY_ELEMENT                                ~17     $24, 2
         41        ASSIGN                                                   !1, ~17
   19    42        INIT_FCALL                                               'array_udiff_assoc'
         43        SEND_VAR                                                 !0
         44        SEND_VAR                                                 !1
         45        SEND_VAL                                                 <array>
         46        DO_ICALL                                         $27     
         47        ASSIGN                                                   !2, $27
   20    48        INIT_FCALL                                               'print_r'
         49        SEND_VAR                                                 !2
         50        DO_ICALL                                                 
         51      > RETURN                                                   1

Class cr:
Function cr:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kTqsY
function name:  cr
number of ops:  4
compiled vars:  !0 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'priv_member'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function cr

Function comp_func_cr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 7
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kTqsY
function name:  comp_func_cr
number of ops:  16
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        FETCH_OBJ_R                                      ~2      !0, 'priv_member'
          3        FETCH_OBJ_R                                      ~3      !1, 'priv_member'
          4        IS_IDENTICAL                                             ~2, ~3
          5      > JMPZ                                                     ~4, ->7
          6    > > RETURN                                                   0
   12     7    >   FETCH_OBJ_R                                      ~5      !0, 'priv_member'
          8        FETCH_OBJ_R                                      ~6      !1, 'priv_member'
          9        IS_SMALLER                                               ~6, ~5
         10      > JMPZ                                                     ~7, ->13
         11    >   QM_ASSIGN                                        ~8      1
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~8      -1
         14    > > RETURN                                                   ~8
   13    15*     > RETURN                                                   null

End of function comp_func_cr

End of class cr.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.3 ms | 1400 KiB | 17 Q