3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PhpXmlBugTester { var $parsedData = ''; var $ok = false; function __construct() { $charData = '<b>c</b>'; $xml = '<a>' . htmlspecialchars( $charData ) . '</a>'; $parser = xml_parser_create(); xml_set_character_data_handler( $parser, array( $this, 'chardata' ) ); $parsedOk = xml_parse( $parser, $xml, true ); $this->ok = $parsedOk && ( $this->parsedData == $charData ); } function chardata( $parser, $data ) { $this->parsedData .= $data; } } $t = new PhpXmlBugTester; var_dump($t->ok);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tk27c
function name:  (null)
number of ops:  8
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'PhpXmlBugTester'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_FCALL                                               'var_dump'
          4        FETCH_OBJ_R                                      ~4      !0, 'ok'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Class PhpXmlBugTester:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/Tk27c
function name:  __construct
number of ops:  30
compiled vars:  !0 = $charData, !1 = $xml, !2 = $parser, !3 = $parsedOk
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, '%3Cb%3Ec%3C%2Fb%3E'
    9     1        INIT_FCALL                                               'htmlspecialchars'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $5      
          4        CONCAT                                           ~6      '%3Ca%3E', $5
          5        CONCAT                                           ~7      ~6, '%3C%2Fa%3E'
          6        ASSIGN                                                   !1, ~7
   11     7        INIT_FCALL                                               'xml_parser_create'
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
   12    10        INIT_FCALL                                               'xml_set_character_data_handler'
         11        SEND_VAR                                                 !2
         12        FETCH_THIS                                       ~11     
         13        INIT_ARRAY                                       ~12     ~11
         14        ADD_ARRAY_ELEMENT                                ~12     'chardata'
         15        SEND_VAL                                                 ~12
         16        DO_ICALL                                                 
   13    17        INIT_FCALL                                               'xml_parse'
         18        SEND_VAR                                                 !2
         19        SEND_VAR                                                 !1
         20        SEND_VAL                                                 <true>
         21        DO_ICALL                                         $14     
         22        ASSIGN                                                   !3, $14
   14    23      > JMPZ_EX                                          ~17     !3, ->27
         24    >   FETCH_OBJ_R                                      ~18     'parsedData'
         25        IS_EQUAL                                         ~19     !0, ~18
         26        BOOL                                             ~17     ~19
         27    >   ASSIGN_OBJ                                               'ok'
         28        OP_DATA                                                  ~17
   15    29      > RETURN                                                   null

End of function __construct

Function chardata:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Tk27c
function name:  chardata
number of ops:  5
compiled vars:  !0 = $parser, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   18     2        ASSIGN_OBJ_OP                                 8          'parsedData'
          3        OP_DATA                                                  !1
   19     4      > RETURN                                                   null

End of function chardata

End of class PhpXmlBugTester.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
294.17 ms | 1014 KiB | 18 Q