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 = array_map(function($arg){ get_object_vars(json_decode($arg)); }, func_get_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/l9CdP
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'
   13     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/l9CdP
function name:  isLikeThis
number of ops:  17
compiled vars:  !0 = $description, !1 = $tested, !2 = $args
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2        INIT_FCALL                                               'array_map'
          3        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2Fl9CdP%3A6%240'
    8     4        SEND_VAL                                                 ~3
    9     5        FUNC_GET_ARGS                                    ~4      
          6        SEND_VAL                                                 ~4
          7        DO_ICALL                                         $5      
    6     8        ASSIGN                                                   !2, $5
   11     9        INIT_FCALL                                               'array_diff_assoc'
         10        SEND_ARRAY                                               !2
         11        CHECK_UNDEF_ARGS                                         
         12        DO_FCALL                                      0  $7      
         13        BOOL                                             ~8      $7
         14        BOOL_NOT                                         ~9      ~8
         15      > RETURN                                                   ~9
   12    16*     > RETURN                                                   null

End of function islikethis

Function %00%7Bclosure%7D%2Fin%2Fl9CdP%3A6%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l9CdP
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     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                                                 
    8     7      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2Fl9CdP%3A6%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.21 ms | 1403 KiB | 24 Q