3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Active assert and make it quiet assert_options(ASSERT_ACTIVE, 1); // Create a handler function function my_assert_handler($file, $line, $code, $desc = null) { echo "Assertion failed at $file:$line: $code"; if ($desc) { echo ": $desc"; } echo "\n"; } // Set up the callback assert_options(ASSERT_CALLBACK, 'phpinfo'); // Make an assertion that should fail assert('2 < 1'); assert('2 < 1', '<img src=1>');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n84k7
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'assert_options'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
   17     4        INIT_FCALL                                               'assert_options'
          5        SEND_VAL                                                 2
          6        SEND_VAL                                                 'phpinfo'
          7        DO_ICALL                                                 
   20     8        ASSERT_CHECK                                             
          9        INIT_FCALL                                               'assert'
         10        SEND_VAL                                                 '2+%3C+1'
         11        SEND_VAL                                                 'assert%28%272+%3C+1%27%29'
         12        DO_ICALL                                                 
   21    13        ASSERT_CHECK                                             
         14        INIT_FCALL                                               'assert'
         15        SEND_VAL                                                 '2+%3C+1'
         16        SEND_VAL                                                 '%3Cimg+src%3D1%3E'
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function my_assert_handler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/n84k7
function name:  my_assert_handler
number of ops:  17
compiled vars:  !0 = $file, !1 = $line, !2 = $code, !3 = $desc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
          3        RECV_INIT                                        !3      null
    9     4        ROPE_INIT                                     6  ~5      'Assertion+failed+at+'
          5        ROPE_ADD                                      1  ~5      ~5, !0
          6        ROPE_ADD                                      2  ~5      ~5, '%3A'
          7        ROPE_ADD                                      3  ~5      ~5, !1
          8        ROPE_ADD                                      4  ~5      ~5, '%3A+'
          9        ROPE_END                                      5  ~4      ~5, !2
         10        ECHO                                                     ~4
   10    11      > JMPZ                                                     !3, ->15
   11    12    >   NOP                                                      
         13        FAST_CONCAT                                      ~8      '%3A+', !3
         14        ECHO                                                     ~8
   13    15    >   ECHO                                                     '%0A'
   14    16      > RETURN                                                   null

End of function my_assert_handler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.83 ms | 1396 KiB | 17 Q