3v4l.org

run code in 300+ PHP versions simultaneously
<?php $desc = '{"a":1, "b":2}'; $ob = '{"a":1, "b":2, "c":3}'; function isLikeThis(string $description, string $tested) { $args = func_get_args(); $assocArrayArgs = array_map(function($arg){ get_object_vars(json_decode($arg)); }, $args ); var_dump($args); return !(bool)call_user_func_array('array_diff_assoc', $args); } var_dump(isLikeThis($desc, $ob));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6i6Yg
function name:  (null)
number of ops:  10
compiled vars:  !0 = $desc, !1 = $ob
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%22a%22%3A1%2C+%22b%22%3A2%7D'
    4     1        ASSIGN                                                   !1, '%7B%22a%22%3A1%2C+%22b%22%3A2%2C+%22c%22%3A3%7D'
   15     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'islikethis'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

Function islikethis:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6i6Yg
function name:  isLikeThis
number of ops:  21
compiled vars:  !0 = $description, !1 = $tested, !2 = $args, !3 = $assocArrayArgs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        FUNC_GET_ARGS                                    ~4      
          3        ASSIGN                                                   !2, ~4
    7     4        INIT_FCALL                                               'array_map'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F6i6Yg%3A7%240'
    9     6        SEND_VAL                                                 ~6
   10     7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $7      
    7     9        ASSIGN                                                   !3, $7
   12    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
   13    13        INIT_FCALL                                               'array_diff_assoc'
         14        SEND_ARRAY                                               !2
         15        CHECK_UNDEF_ARGS                                         
         16        DO_FCALL                                      0  $10     
         17        BOOL                                             ~11     $10
         18        BOOL_NOT                                         ~12     ~11
         19      > RETURN                                                   ~12
   14    20*     > RETURN                                                   null

End of function islikethis

Function %00%7Bclosure%7D%2Fin%2F6i6Yg%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6i6Yg
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'get_object_vars'
          2        INIT_FCALL                                               'json_decode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
    9     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F6i6Yg%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.13 ms | 1403 KiB | 24 Q