3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private function __construct() { } public function bar() { echo 'Never gonna give you up' . PHP_EOL; } } $hijacked = 'O:3:"Foo":0:{}'; $instantiated = unserialize($hijacked); $instantiated->bar(); var_dump($instantiated);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N8ZXa
function name:  (null)
number of ops:  11
compiled vars:  !0 = $hijacked, !1 = $instantiated
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'O%3A3%3A%22Foo%22%3A0%3A%7B%7D'
   12     1        INIT_FCALL                                               'unserialize'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   14     5        INIT_METHOD_CALL                                         !1, 'bar'
          6        DO_FCALL                                      0          
   15     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N8ZXa
function name:  __construct
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   null

End of function __construct

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/N8ZXa
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     'Never+gonna+give+you+up%0A'
    8     1      > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.91 ms | 1395 KiB | 17 Q