3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc = [ 'Stops' => [ ['order_number' => 123, 'whatever' => 'meh'], ['order_number' => 124, 'whatever' => 'meh again'], ] ]; $object = new class() { public $Stops = []; public function __construct() { $this->Stops []= new class() { public $order_number = 123; public $whatever = 'meh'; }; $this->Stops []= new class() { public $order_number = 124; public $whatever = 'meh again'; }; } }; echo json_encode($assoc); echo "\n"; echo json_encode($object);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mGmXi
function name:  (null)
number of ops:  15
compiled vars:  !0 = $assoc, !1 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   10     1        DECLARE_ANON_CLASS                               <unknown> 
          2        NEW                                              $4      $3
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   24     5        INIT_FCALL                                               'json_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8        ECHO                                                     $7
   25     9        ECHO                                                     '%0A'
   26    10        INIT_FCALL                                               'json_encode'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $8      
         13        ECHO                                                     $8
         14      > RETURN                                                   1

Class class@anonymous: [no user functions]
Class class@anonymous: [no user functions]
Class class@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mGmXi
function name:  __construct
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_ANON_CLASS                               <ptr>   
          1        NEW                                              $3      $2
          2        DO_FCALL                                      0          
          3        FETCH_OBJ_W                                      $0      'Stops'
          4        ASSIGN_DIM                                               $0
          5        OP_DATA                                                  $3
   17     6        DECLARE_ANON_CLASS                               <unknown> 
          7        NEW                                              $8      $7
          8        DO_FCALL                                      0          
          9        FETCH_OBJ_W                                      $5      'Stops'
         10        ASSIGN_DIM                                               $5
         11        OP_DATA                                                  $8
   21    12      > RETURN                                                   null

End of function __construct

End of class class@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.86 ms | 1396 KiB | 15 Q