3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Post { protected $title; protected $text; protected $filters; function __construct($title, $text, $filters) { $this->title = $title; $this->text = $text; $this->filters = $filters; } function get_title() { return htmlspecialchars($this->title); } function display_post() { $text = htmlspecialchars($this->text); foreach ($this->filters as $filter) $text = $filter->filter($text); return $text; } function __destruct() { // debugging stuff $s = "<!-- POST " . htmlspecialchars($this->title); $text = htmlspecialchars($this->text); foreach ($this->filters as $filter) $text = $filter->filter($text); $s = $s . ": " . $text; $s = $s . " -->"; echo $s; } }; echo unserialize(serialize(new Post("huehuehue i repor u", new SplFileObject("/home/daedalus/flag.txt"), Array())));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OHEAt
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   INIT_FCALL                                               'unserialize'
          1        INIT_FCALL                                               'serialize'
          2        NEW                                              $0      'Post'
          3        SEND_VAL_EX                                              'huehuehue+i+repor+u'
          4        NEW                                              $1      'SplFileObject'
          5        SEND_VAL_EX                                              '%2Fhome%2Fdaedalus%2Fflag.txt'
          6        DO_FCALL                                      0          
          7        SEND_VAR_NO_REF_EX                                       $1
          8        SEND_VAL_EX                                              <array>
          9        DO_FCALL                                      0          
         10        SEND_VAR                                                 $0
         11        DO_ICALL                                         $4      
         12        SEND_VAR                                                 $4
         13        DO_ICALL                                         $5      
         14        ECHO                                                     $5
         15      > RETURN                                                   1

Class Post:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OHEAt
function name:  __construct
number of ops:  10
compiled vars:  !0 = $title, !1 = $text, !2 = $filters
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    7     3        ASSIGN_OBJ                                               'title'
          4        OP_DATA                                                  !0
    8     5        ASSIGN_OBJ                                               'text'
          6        OP_DATA                                                  !1
    9     7        ASSIGN_OBJ                                               'filters'
          8        OP_DATA                                                  !2
   10     9      > RETURN                                                   null

End of function __construct

Function get_title:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OHEAt
function name:  get_title
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'htmlspecialchars'
          1        FETCH_OBJ_R                                      ~0      'title'
          2        SEND_VAL                                                 ~0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   14     5*     > RETURN                                                   null

End of function get_title

Function display_post:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 13
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 13
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/OHEAt
function name:  display_post
number of ops:  16
compiled vars:  !0 = $text, !1 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'htmlspecialchars'
          1        FETCH_OBJ_R                                      ~2      'text'
          2        SEND_VAL                                                 ~2
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   18     5        FETCH_OBJ_R                                      ~5      'filters'
          6      > FE_RESET_R                                       $6      ~5, ->13
          7    > > FE_FETCH_R                                               $6, !1, ->13
   19     8    >   INIT_METHOD_CALL                                         !1, 'filter'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $7      
         11        ASSIGN                                                   !0, $7
   18    12      > JMP                                                      ->7
         13    >   FE_FREE                                                  $6
   20    14      > RETURN                                                   !0
   21    15*     > RETURN                                                   null

End of function display_post

Function __destruct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 19
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/OHEAt
function name:  __destruct
number of ops:  27
compiled vars:  !0 = $s, !1 = $text, !2 = $filter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'htmlspecialchars'
          1        FETCH_OBJ_R                                      ~3      'title'
          2        SEND_VAL                                                 ~3
          3        DO_ICALL                                         $4      
          4        CONCAT                                           ~5      '%3C%21--+POST+', $4
          5        ASSIGN                                                   !0, ~5
   26     6        INIT_FCALL                                               'htmlspecialchars'
          7        FETCH_OBJ_R                                      ~7      'text'
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !1, $8
   27    11        FETCH_OBJ_R                                      ~10     'filters'
         12      > FE_RESET_R                                       $11     ~10, ->19
         13    > > FE_FETCH_R                                               $11, !2, ->19
   28    14    >   INIT_METHOD_CALL                                         !2, 'filter'
         15        SEND_VAR_EX                                              !1
         16        DO_FCALL                                      0  $12     
         17        ASSIGN                                                   !1, $12
   27    18      > JMP                                                      ->13
         19    >   FE_FREE                                                  $11
   29    20        CONCAT                                           ~14     !0, '%3A+'
         21        CONCAT                                           ~15     ~14, !1
         22        ASSIGN                                                   !0, ~15
   30    23        CONCAT                                           ~17     !0, '+--%3E'
         24        ASSIGN                                                   !0, ~17
   31    25        ECHO                                                     !0
   32    26      > RETURN                                                   null

End of function __destruct

End of class Post.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.53 ms | 1396 KiB | 19 Q