3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Herman { private $milk; public function gotMilkToday() { return $this->milk; } public function setMilk($flag) { $this->milk = $flag; } } $hermit = new Herman(); $hermit->setMilk(false); $serialized = serialize($hermit); var_dump("Serialized: ${serialized}", unserialize($serialized)->gotMilkToday());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1KUeC
function name:  (null)
number of ops:  22
compiled vars:  !0 = $hermit, !1 = $serialized
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $2      'Herman'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   18     3        INIT_METHOD_CALL                                         !0, 'setMilk'
          4        SEND_VAL_EX                                              <false>
          5        DO_FCALL                                      0          
   20     6        INIT_FCALL                                               'serialize'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
   22    10        INIT_FCALL                                               'var_dump'
         11        NOP                                                      
         12        FAST_CONCAT                                      ~8      'Serialized%3A+', !1
         13        SEND_VAL                                                 ~8
         14        INIT_FCALL                                               'unserialize'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                         $9      
         17        INIT_METHOD_CALL                                         $9, 'gotMilkToday'
         18        DO_FCALL                                      0  $10     
         19        SEND_VAR                                                 $10
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

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

End of function gotmilktoday

Function setmilk:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1KUeC
function name:  setMilk
number of ops:  4
compiled vars:  !0 = $flag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        ASSIGN_OBJ                                               'milk'
          2        OP_DATA                                                  !0
   14     3      > RETURN                                                   null

End of function setmilk

End of class Herman.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.48 ms | 1396 KiB | 19 Q