Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
93 views

We have a multi-tenanted PHP application. This application provides a set of core functionality, and then on a per tenant basis we can build web applications, leveraging and extending the core. From ...
GuruBob's user avatar
  • 1,034
2 votes
1 answer
209 views

I recently upgraded my Symfony project from 5.4 to 6.4.13. Now, I am encountering an error when running the Symfony translation debug php bin/console debug:translation en command in my project. The ...
Jeroen's user avatar
  • 50
0 votes
1 answer
423 views

I am creating a Rector (rector/rector) rule that should alter properties based on some of their attributes. PhpParser is from nikic/php-parser. I have no problem fetching the Properties, I simply ...
jave.web's user avatar
  • 15.3k
1 vote
1 answer
605 views

In my project I want to analyze the source code of a PHP file and convert it to AST. There is already a javascript package for this, but it only works with node. So I tried to convert the PHP code to ...
eddieconnecti's user avatar
1 vote
1 answer
67 views

I want to change /<\?php\s([\s\S]*?)\?>/gi the way that single line PHP tags become excluded. For example, here I want to match only second PHP tag and not the first one: Test number <?PHP ...
Reza Alizade's user avatar
2 votes
0 answers
204 views

Now I need a Visitor to extract the HTML tag from the PHP file. At first, I thought I would just extract the Value of a Node of type InLineHTML. Just like this if ($node instanceof Node\Stmt\...
L2ksy0d's user avatar
  • 83
1 vote
1 answer
725 views

In the first.php file, I assigned some variables and defined some constant values, define("CONSTANT1", "cons1value"); $variable1 = "var1value"; $variable2 = array( &...
Md Jahid Khan Limon's user avatar
0 votes
2 answers
157 views

<section index="2.3" title="No HTTP(S) Server Session Timeout or HTTP(S) Server Idle Timeout Set" ref="ADMINISTRATION.WEBTIMEOUT.NO.HTTP.OR.HTTPS.SESSION.OR.IDLE.TIMEOUT....
Murali's user avatar
  • 1
0 votes
2 answers
206 views

I want to extract and run PHP functions from a JSON string variable. my string variable is something like this : $str = '"field_table_id": { "element_name": "select", ...
a.sadegh63's user avatar
0 votes
0 answers
190 views

I'm trying to build a static code analysis tool and I would like to check if the variables in a file are defined. Currently I'm using nikic/PHP-Parser (https://github.com/nikic/PHP-Parser), but I'm ...
user3478148's user avatar
-1 votes
1 answer
500 views

Using nikic/php-parser, I'm trying to read an existing configuration file, find an array node within it, append a new item to this node, then write everything back to the file. Ideally, this should ...
Moritz Friedrich's user avatar
-2 votes
1 answer
321 views

I have the following PHP code file: <?php class ObjectTest extends AppTest { public function getList() { return [ '1234', '5678', ]; } } Now I ...
Henrik Gemal's user avatar
1 vote
1 answer
215 views

I'm using PHP-Parser to parse PHP codes, and get the AST in Json format. I want to ask how to get the results without Attributes ( startLine, endLine, comment etc.)
user12843894's user avatar
1 vote
1 answer
2k views

I'm using PHP-PArser to find the AST of PHP program. For example: code <?php use PhpParser\Error; use PhpParser\NodeDumper; use PhpParser\ParserFactory; $code = <<<'CODE' <?php $...
user12843894's user avatar
0 votes
1 answer
202 views

I'm using PHP-Parser to evaluate the conditions used to traverse the if statement. I just want to know what the conditions used during the traversing of the code. For example: test <?php $val = ...
user12843894's user avatar
1 vote
1 answer
664 views

Minimal example code: <?php $avarname = 'a var value'; function a_function_name($a_parameter = true) { // a comment } a_function_name(); Structure from using ...
PHP Joe's user avatar
  • 61
0 votes
1 answer
225 views

I'm using PHP-Parser to build the AST. Then I want to reach the index of Global variables such as $_POST['firstname'] , so I want to reach the index firstname and get it. How to reach the index of ...
user12843894's user avatar
4 votes
1 answer
1k views

I want to use PHP-Parser library to get the global method (_POST, _GET, _REQUEST) to get values in PHP. I'm using PHP-Parser where I want to check the node name if it equal to (_POST, _GET, _REQUEST). ...
user12843894's user avatar
2 votes
1 answer
834 views

Im using https://github.com/nikic/PHP-Parser. What is a good strategy when wanting to INSERT a node in the AST? With the traverser I can UPDATE and DELETE nodes easily using a NodeTraverser class. But ...
ajthinking's user avatar
  • 4,906
1 vote
0 answers
129 views

I have a local xml file which I am trying to display over a webpage with following code. All I get is a blank page. <?php $xml_content = file_get_contents("C:\Users\user\Downloads\93D7.xml&...
7strings's user avatar
0 votes
3 answers
251 views

I use PHP-Parser in my project. I would like to compare two nodes, using PHPUnit's assertEquals function. Despite the nodes are the same, it gives a false result. The reason is, that one of the nodes ...
Iter Ator's user avatar
  • 9,049
0 votes
1 answer
54 views

I am using the package nikic/php-parser to parse a PHP file that is provide by the user. This file will have some PHP functions and I need to know which one are and the exact offset and length of the ...
David Rodrigues's user avatar
1 vote
2 answers
651 views

I read somewhere that php parses the whole .php file every time it is executed. Some solution was proposed in there (that was not opcache), but I lost the website and I couldn't find it. Now I have ...
algo's user avatar
  • 118
0 votes
1 answer
632 views

Now I am trying to write a PhP parser and I don't why my code return an empty array. I am using PHP Simple HTML DOM. I know my code is't perfect, but it's only for testing. I will be appreciate for ...
Владислав Стук's user avatar
0 votes
0 answers
293 views

I'm building a class to replace the old one online. We have old projects in php 5.3. And new php 5.6 and 7.0 projects. Developers wish to use new features such as 'yield' in new verions, but the class ...
maybeonly's user avatar
2 votes
1 answer
839 views

Do you know about some markdown PHP parser, with code highlight, etc, like the GitHub markdown parser or https://stackedit.io/editor? If it is available via Composer then better. I've tried: https:/...
Angel's user avatar
  • 681
2 votes
0 answers
324 views

I am trying to parse a "rules string" provided over an API in PHP. Given that I have an array of items such as $items = [41, 42, 51, 54, 65, 12]; I wish to evaluate this expression ({41} AND {51}) ...
Simon Bowen's user avatar
0 votes
2 answers
588 views

I would like my Hack code to be broken down to Abstract Syntax Tree. Please advise me on available tools/libraries/github repositories which will help me to parse Hack code into AST. I have found "...
Adel Maratova's user avatar
0 votes
2 answers
863 views

Kay I got really stuck on this one :/ Tried SimpleHTMLDom as mentioned in the title and DOMDocument so far.. The $html will come from CKEditor in my Processwire driven page, I made a textformatter to ...
Can Rau's user avatar
  • 3,920
1 vote
1 answer
111 views

$response var has a component called custom_test_name which looks like below: [Test_Name]ad.no.check1.check2.check3 and here is the small PHP code: <?php echo "<class="."com.tests.".$...
Pratik Jaiswal's user avatar
-1 votes
1 answer
98 views

I need to implement a PHP file to read x files from a directory and every time update a table in my db. With the update no problem but, i'm not the best with xml in php. So, this is the xml file: &...
Matteo Galante's user avatar
2 votes
1 answer
654 views

I'm facing an issue where the parser is going out of memory - /nikic/php-parser/lib/PHPParser/Node/Expr/Identical.php on line 25 /nikic/php-parser/lib/PHPParser/Parser.php on line 1044 And this is ...
PlanetUnknown's user avatar
5 votes
1 answer
237 views

Just learned that Laravel using nikic phpparser internally. I modified my code to sending emails on one of the conditions & it started dying. The PHP logs showed this : [Sat Oct 03 21:18:23 ...
PlanetUnknown's user avatar
0 votes
1 answer
346 views

I have created a php parser that must extract the price in a span tag, but when I echo the $html so that I could see how the page loads, it shows me a broken page with no contents. Instead only ...
Alvin Ofori-Adjei's user avatar
2 votes
4 answers
256 views

I have a json feed in a URL that contains following data. <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/"> [{"ID":1123,"OrderNumber":"1394","ProjectType":"Postcard","...
LSN's user avatar
  • 328
-3 votes
2 answers
335 views

I wonder if it exists pretty printer for php-parser which is capable to enforce desired maximum line length? (It seems rather simple to implement for some basic cases (array elements list, function ...
ts.'s user avatar
  • 10.7k
0 votes
1 answer
158 views

Using PHP-Parser, when I am traversing the nodes in a program, how do I find the type of an object? For example, in the program below, when I encounter the node $a->some_method(); how do I find ...
user45183's user avatar
  • 619
0 votes
1 answer
173 views

I'm trying to pass the variables data from php1.php to php2.php. this is what I'm trying to do: I'm using php to load a xml(not validated with feedvalidator.org) from a url, and then to pass the ...
Mr. Mol's user avatar
  • 29
0 votes
0 answers
207 views

I'm parsing html page. Results are different on local and live server. On local server it displays all information but on live it skips many. Here is my code <?php error_reporting(E_ERROR | ...
Tashen Jazbi's user avatar
  • 1,068
0 votes
3 answers
2k views

I want to get the innerHtml from an element, with simple html dom parser. For example: $s = " <div class="a"> <p>I don't want this stuff</p> &...
user3564958's user avatar
2 votes
0 answers
271 views

I am using Ubuntu 14 and Nginx. I'm getting this error when trying to install PHP-Parser. composer install Loading composer repositories with package information Installing dependencies (including ...
user3782925's user avatar
1 vote
2 answers
108 views

To have my project respond to certain contexts of content, I want my CSS files to respond respectively instead of setting up additional CSS files (adds to http requests) or parsing the CSS right ...
Amanahumpa's user avatar
-1 votes
1 answer
93 views

I have done this little script. <?php $url = "http://resurse.fibula.ro/parteneri/xmlhotels.php?location=belek&myid=travelplaza"; $xml = simplexml_load_file($url); foreach($xml->hotel as $...
Valy's user avatar
  • 27
0 votes
1 answer
99 views

I would like to show all files i share on my owncloud instance on my "normal" homepage. The URL of my owncloudserver is: https://cloud.berndklaus.at/public.php?service=files&t=...
Berndinox's user avatar
  • 2,514
1 vote
1 answer
302 views

I have been trying to parse the the title and description from the following XML document (this is just the top part). I have found lots of information about dealing with namespaces but I cannot ...
Bren's user avatar
  • 3,768
0 votes
1 answer
114 views

I have a copy of a PHP website and there are a lot of pages and a lot of code there. It uses conditional statements to determine what contents should be printed very much. Here's an example(there may ...
ChandlerQ's user avatar
  • 1,438
1 vote
1 answer
4k views

I used SCEditor in my forum. I managed inserting bbcodes to database. But when I try to show codes in the page, bbcodes are shown without styling. No html, no style. Only bad bbcodes. I am ...
user avatar
0 votes
1 answer
92 views

I am very new to PHP, its not my domain however right now I have a need to pull a certain value from a website, I looked up on the internet and found the following function which I implemented as per ...
user2613996's user avatar
0 votes
1 answer
163 views

This is a .mov file that is read into php script. The file will not always be the same. //[HMS Movie Line-Up File] //[Version 3] // Lineup=_2013_05 // Field definitions for movie category lines: // 1....
ValleyDigital's user avatar
2 votes
1 answer
189 views

I have a regex for finding all function definitions. What I want to do now is to get also the contents in the functions e.g. as third field in $matches is that possible using regex or do I need some ...
Karl Adler's user avatar
  • 16.9k