3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Job { public array $options; public function __construct(public int $a, $options = []) {} } $job = new Job(1); echo serialize($job); // O:3:"Job":1:{s:7:"options";a:0:{}} echo ' '; var_dump(unserialize('O:3:"Job":1:{s:7:"options";a:0:{}}'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tYqsH
function name:  (null)
number of ops:  16
compiled vars:  !0 = $job
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'Job'
          1        SEND_VAL_EX                                              1
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   12     4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ECHO                                                     $4
   13     8        ECHO                                                     '%0A%0A'
   16     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'unserialize'
         11        SEND_VAL                                                 'O%3A3%3A%22Job%22%3A1%3A%7Bs%3A7%3A%22options%22%3Ba%3A0%3A%7B%7D%7D'
         12        DO_ICALL                                         $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Class Job:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/tYqsH
function name:  __construct
number of ops:  5
compiled vars:  !0 = $a, !1 = $options
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
          2        ASSIGN_OBJ                                               'a'
          3        OP_DATA                                                  !0
          4      > RETURN                                                   null

End of function __construct

End of class Job.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.19 ms | 1012 KiB | 16 Q