3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.07 ms | 1400 KiB | 15 Q