3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; private $baz; public function __construct($bar, $baz) { $this->bar = $bar; $this->baz = $baz; } } $foo = new Foo('hello','word'); $json = json_encode($foo); echo $json; $serialize = serialize($foo); echo $serialize; var_dump( json_decode($json) ); var_dump( deserialize($serialize) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2JcFT
function name:  (null)
number of ops:  28
compiled vars:  !0 = $foo, !1 = $json, !2 = $serialize
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $3      'Foo'
          1        SEND_VAL_EX                                              'hello'
          2        SEND_VAL_EX                                              'word'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $3
   17     5        INIT_FCALL                                               'json_encode'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !1, $6
   18     9        ECHO                                                     !1
   20    10        INIT_FCALL                                               'serialize'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
   21    14        ECHO                                                     !2
   23    15        INIT_FCALL                                               'var_dump'
         16        INIT_FCALL                                               'json_decode'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
   24    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL_BY_NAME                                       'deserialize'
         23        SEND_VAR_EX                                              !2
         24        DO_FCALL                                      0  $12     
         25        SEND_VAR                                                 $12
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2JcFT
function name:  __construct
number of ops:  7
compiled vars:  !0 = $bar, !1 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   10     2        ASSIGN_OBJ                                               'bar'
          3        OP_DATA                                                  !0
   11     4        ASSIGN_OBJ                                               'baz'
          5        OP_DATA                                                  !1
   12     6      > RETURN                                                   null

End of function __construct

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.43 ms | 1401 KiB | 21 Q