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:  21
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'assert_options'
          1        FETCH_CONSTANT                                   ~0      'ASSERT_ACTIVE'
          2        SEND_VAL                                                 ~0
          3        SEND_VAL                                                 1
          4        DO_FCALL_BY_NAME                                         
   17     5        INIT_FCALL                                               'assert_options'
          6        FETCH_CONSTANT                                   ~2      'ASSERT_CALLBACK'
          7        SEND_VAL                                                 ~2
          8        SEND_VAL                                                 'phpinfo'
          9        DO_FCALL_BY_NAME                                         
   20    10        ASSERT_CHECK                                             
         11        INIT_FCALL                                               'assert'
         12        SEND_VAL                                                 '2+%3C+1'
         13        SEND_VAL                                                 'assert%28%272+%3C+1%27%29'
         14        DO_ICALL                                                 
   21    15        ASSERT_CHECK                                             
         16        INIT_FCALL                                               'assert'
         17        SEND_VAL                                                 '2+%3C+1'
         18        SEND_VAL                                                 '%3Cimg+src%3D1%3E'
         19        DO_ICALL                                                 
         20      > 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:
145.48 ms | 1465 KiB | 15 Q