3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); include('pdo.php'); require_once 'tools/HTMLPurifier.standalone.php'; $editFlag = $_POST['editFlag'] ?? false; $contentID = $_POST['id'] ?? false; $userContent = $_POST['userContent'] ?? false; $section = 1; $config = HTMLPurifier_Config::createDefault(); $purifier = new HTMLPurifier($config); $clean_html = $purifier->purify($userContent); if ($editFlag != "1"){ $stmt = $db->prepare("INSERT INTO userContent (section, author, content) VALUES (:section, :author, :content)"); $stmt->execute(['section' => $section, 'author' => $author, 'content' => $content]); } else { $stmt = $db->prepare("UPDATE userContent SET section=:section, author=:author, content=:content WHERE id=:contentID"); $stmt->execute(['section' => $section, 'author' => $author, 'content' => $content, 'contentID' => $contentID]); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 44
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Jb5Ga
function name:  (null)
number of ops:  56
compiled vars:  !0 = $editFlag, !1 = $contentID, !2 = $userContent, !3 = $section, !4 = $config, !5 = $purifier, !6 = $clean_html, !7 = $stmt, !8 = $db, !9 = $author, !10 = $content
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'session_start'
          1        DO_ICALL                                                 
    3     2        INCLUDE_OR_EVAL                                          'pdo.php', INCLUDE
    4     3        INCLUDE_OR_EVAL                                          'tools%2FHTMLPurifier.standalone.php', REQUIRE_ONCE
    5     4        FETCH_IS                                         ~14     '_POST'
          5        FETCH_DIM_IS                                     ~15     ~14, 'editFlag'
          6        COALESCE                                         ~16     ~15
          7        QM_ASSIGN                                        ~16     <false>
          8        ASSIGN                                                   !0, ~16
    6     9        FETCH_IS                                         ~18     '_POST'
         10        FETCH_DIM_IS                                     ~19     ~18, 'id'
         11        COALESCE                                         ~20     ~19
         12        QM_ASSIGN                                        ~20     <false>
         13        ASSIGN                                                   !1, ~20
    7    14        FETCH_IS                                         ~22     '_POST'
         15        FETCH_DIM_IS                                     ~23     ~22, 'userContent'
         16        COALESCE                                         ~24     ~23
         17        QM_ASSIGN                                        ~24     <false>
         18        ASSIGN                                                   !2, ~24
    8    19        ASSIGN                                                   !3, 1
    9    20        INIT_STATIC_METHOD_CALL                                  'HTMLPurifier_Config', 'createDefault'
         21        DO_FCALL                                      0  $27     
         22        ASSIGN                                                   !4, $27
   10    23        NEW                                              $29     'HTMLPurifier'
         24        SEND_VAR_EX                                              !4
         25        DO_FCALL                                      0          
         26        ASSIGN                                                   !5, $29
   11    27        INIT_METHOD_CALL                                         !5, 'purify'
         28        SEND_VAR_EX                                              !2
         29        DO_FCALL                                      0  $32     
         30        ASSIGN                                                   !6, $32
   13    31        IS_NOT_EQUAL                                             !0, '1'
         32      > JMPZ                                                     ~34, ->44
   14    33    >   INIT_METHOD_CALL                                         !8, 'prepare'
         34        SEND_VAL_EX                                              'INSERT+INTO+userContent+%28section%2C+author%2C+content%29+VALUES+%28%3Asection%2C+%3Aauthor%2C+%3Acontent%29'
         35        DO_FCALL                                      0  $35     
         36        ASSIGN                                                   !7, $35
   15    37        INIT_METHOD_CALL                                         !7, 'execute'
         38        INIT_ARRAY                                       ~37     !3, 'section'
         39        ADD_ARRAY_ELEMENT                                ~37     !9, 'author'
         40        ADD_ARRAY_ELEMENT                                ~37     !10, 'content'
         41        SEND_VAL_EX                                              ~37
         42        DO_FCALL                                      0          
         43      > JMP                                                      ->55
   17    44    >   INIT_METHOD_CALL                                         !8, 'prepare'
         45        SEND_VAL_EX                                              'UPDATE+userContent+SET+section%3D%3Asection%2C+author%3D%3Aauthor%2C+content%3D%3Acontent+WHERE+id%3D%3AcontentID'
         46        DO_FCALL                                      0  $39     
         47        ASSIGN                                                   !7, $39
   18    48        INIT_METHOD_CALL                                         !7, 'execute'
         49        INIT_ARRAY                                       ~41     !3, 'section'
         50        ADD_ARRAY_ELEMENT                                ~41     !9, 'author'
         51        ADD_ARRAY_ELEMENT                                ~41     !10, 'content'
         52        ADD_ARRAY_ELEMENT                                ~41     !1, 'contentID'
         53        SEND_VAL_EX                                              ~41
         54        DO_FCALL                                      0          
   20    55    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.09 ms | 1400 KiB | 15 Q