3v4l.org

run code in 300+ PHP versions simultaneously
<?php // classa.inc: class A { public $one = 1; public function show_one() { echo $this->one; } } // page1. $a = new A; $s = serialize($a); // store $s somewhere where page2.php can find it. file_put_contents('store', $s); // page2.php: // this is needed for the unserialize to work properly. $s = file_get_contents('store'); $a = unserialize($s); // now use the function show_one() of the $a object. $a->show_one(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sp51Z
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $2      'A'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   15     3        INIT_FCALL                                               'serialize'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !1, $5
   17     7        INIT_FCALL                                               'file_put_contents'
          8        SEND_VAL                                                 'store'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
   24    11        INIT_FCALL                                               'file_get_contents'
         12        SEND_VAL                                                 'store'
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !1, $8
   25    15        INIT_FCALL                                               'unserialize'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !0, $10
   28    19        INIT_METHOD_CALL                                         !0, 'show_one'
         20        DO_FCALL                                      0          
   29    21      > RETURN                                                   1

Class A:
Function show_one:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sp51Z
function name:  show_one
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_OBJ_R                                      ~0      'one'
          1        ECHO                                                     ~0
    9     2      > RETURN                                                   null

End of function show_one

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.43 ms | 1395 KiB | 21 Q