3v4l.org

run code in 300+ PHP versions simultaneously
<?php $student_comment_new = 'PDI+PEwuMDIwMzEwNDAwODAtVC01UC01PlJvbiBDb21tZW50IDI8ZS4yPg=='; $fixed = base64_decode($student_comment_new); echo $fixed . "\n\n"; //Decode the entire comment $comment_cltxt = base64_decode($student_comment_new); echo $comment_cltxt . "\n\n"; //get the comment number. $comment_nr = explode('><L.', $comment_cltxt)[0]; $comment_nr = explode('<', $comment_nr)[1]; //get the comment end-text $comment_nr_string = '<' . $comment_nr . '>'; $comment_end_string = '<e.' . $comment_nr . '>'; echo $comment_nr . "\n"; echo $comment_nr_string . "\n"; echo $comment_end_string . "\n"; //get the comment text itself $pos1 = substr($comment_cltxt, 0, strlen(comment_nr_string)); $pos2 = substr($comment_cltxt, strlen($comment_cltxt) - strlen($comment_end_string)); $comment_text = substr($comment_cltxt, $pos1, $pos2); echo $comment_text . "\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RTsIt
function name:  (null)
number of ops:  62
compiled vars:  !0 = $student_comment_new, !1 = $fixed, !2 = $comment_cltxt, !3 = $comment_nr, !4 = $comment_nr_string, !5 = $comment_end_string, !6 = $pos1, !7 = $pos2, !8 = $comment_text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'PDI%2BPEwuMDIwMzEwNDAwODAtVC01UC01PlJvbiBDb21tZW50IDI8ZS4yPg%3D%3D'
    4     1        INIT_FCALL                                               'base64_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $10     
          4        ASSIGN                                                   !1, $10
    5     5        CONCAT                                           ~12     !1, '%0A%0A'
          6        ECHO                                                     ~12
    8     7        INIT_FCALL                                               'base64_decode'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $13     
         10        ASSIGN                                                   !2, $13
    9    11        CONCAT                                           ~15     !2, '%0A%0A'
         12        ECHO                                                     ~15
   13    13        INIT_FCALL                                               'explode'
         14        SEND_VAL                                                 '%3E%3CL.'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $16     
         17        FETCH_DIM_R                                      ~17     $16, 0
         18        ASSIGN                                                   !3, ~17
   14    19        INIT_FCALL                                               'explode'
         20        SEND_VAL                                                 '%3C'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $19     
         23        FETCH_DIM_R                                      ~20     $19, 1
         24        ASSIGN                                                   !3, ~20
   17    25        CONCAT                                           ~22     '%3C', !3
         26        CONCAT                                           ~23     ~22, '%3E'
         27        ASSIGN                                                   !4, ~23
   18    28        CONCAT                                           ~25     '%3Ce.', !3
         29        CONCAT                                           ~26     ~25, '%3E'
         30        ASSIGN                                                   !5, ~26
   21    31        CONCAT                                           ~28     !3, '%0A'
         32        ECHO                                                     ~28
   22    33        CONCAT                                           ~29     !4, '%0A'
         34        ECHO                                                     ~29
   23    35        CONCAT                                           ~30     !5, '%0A'
         36        ECHO                                                     ~30
   26    37        INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !2
         39        SEND_VAL                                                 0
         40        FETCH_CONSTANT                                   ~31     'comment_nr_string'
         41        STRLEN                                           ~32     ~31
         42        SEND_VAL                                                 ~32
         43        DO_ICALL                                         $33     
         44        ASSIGN                                                   !6, $33
   27    45        INIT_FCALL                                               'substr'
         46        SEND_VAR                                                 !2
         47        STRLEN                                           ~35     !2
         48        STRLEN                                           ~36     !5
         49        SUB                                              ~37     ~35, ~36
         50        SEND_VAL                                                 ~37
         51        DO_ICALL                                         $38     
         52        ASSIGN                                                   !7, $38
   28    53        INIT_FCALL                                               'substr'
         54        SEND_VAR                                                 !2
         55        SEND_VAR                                                 !6
         56        SEND_VAR                                                 !7
         57        DO_ICALL                                         $40     
         58        ASSIGN                                                   !8, $40
   30    59        CONCAT                                           ~42     !8, '%0A'
         60        ECHO                                                     ~42
         61      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.53 ms | 1400 KiB | 19 Q