3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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) );
based on sn8JQ
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/2JcFT
function name:  (null)
number of ops:  29
compiled vars:  !0 = $foo, !1 = $json, !2 = $serialize
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
  15     1        NEW                                              $4      :-6
         2        SEND_VAL_EX                                              'hello'
         3        SEND_VAL_EX                                              'word'
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $4
  17     6        INIT_FCALL                                               'json_encode'
         7        SEND_VAR                                                 !0
         8        DO_ICALL                                         $7      
         9        ASSIGN                                                   !1, $7
  18    10        ECHO                                                     !1
  20    11        INIT_FCALL                                               'serialize'
        12        SEND_VAR                                                 !0
        13        DO_ICALL                                         $9      
        14        ASSIGN                                                   !2, $9
  21    15        ECHO                                                     !2
  23    16        INIT_FCALL                                               'var_dump'
        17        INIT_FCALL                                               'json_decode'
        18        SEND_VAR                                                 !1
        19        DO_ICALL                                         $11     
        20        SEND_VAR                                                 $11
        21        DO_ICALL                                                 
  24    22        INIT_FCALL                                               'var_dump'
        23        INIT_FCALL_BY_NAME                                       'deserialize'
        24        SEND_VAR_EX                                              !2
        25        DO_FCALL                                      0  $13     
        26        SEND_VAR                                                 $13
        27        DO_ICALL                                                 
        28      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
Jump found. 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 7.3.0