diff --git a/components/class_loader/class_map_generator.rst b/components/class_loader/class_map_generator.rst index faf06e88809..b35aa731824 100644 --- a/components/class_loader/class_map_generator.rst +++ b/components/class_loader/class_map_generator.rst @@ -50,7 +50,7 @@ method:: use Symfony\Component\ClassLoader\ClassMapGenerator; - print_r(ClassMapGenerator::createMap(__DIR__.'/library')); + dump(ClassMapGenerator::createMap(__DIR__.'/library')); Given the files and class from the table above, you should see an output like this: diff --git a/components/css_selector.rst b/components/css_selector.rst index 833c8c04205..fb6c5cea7f9 100644 --- a/components/css_selector.rst +++ b/components/css_selector.rst @@ -51,7 +51,7 @@ equivalents:: use Symfony\Component\CssSelector\CssSelector; - print CssSelector::toXPath('div.item > h4 > a'); + dump(CssSelector::toXPath('div.item > h4 > a')); This gives the following output: diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 0ef224d9a9c..b6609ecb192 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -47,7 +47,7 @@ traverse easily:: $crawler = new Crawler($html); foreach ($crawler as $domElement) { - print $domElement->nodeName; + dump($domElement->nodeName); } Specialized :class:`Symfony\\Component\\DomCrawler\\Link` and diff --git a/components/finder.rst b/components/finder.rst index 972f5ae7bcb..4d73e8a4ecb 100644 --- a/components/finder.rst +++ b/components/finder.rst @@ -30,14 +30,14 @@ directories:: $finder->files()->in(__DIR__); foreach ($finder as $file) { - // Print the absolute path - print $file->getRealpath()."\n"; + // Dump the absolute path + dump($file->getRealpath()); - // Print the relative path to the file, omitting the filename - print $file->getRelativePath()."\n"; + // Dump the relative path to the file, omitting the filename + dump($file->getRelativePath()); - // Print the relative path to the file - print $file->getRelativePathname()."\n"; + // Dump the relative path to the file + dump($file->getRelativePathname()); } The ``$file`` is an instance of :class:`Symfony\\Component\\Finder\\SplFileInfo` @@ -121,9 +121,7 @@ And it also works with user-defined streams:: $finder = new Finder(); $finder->name('photos*')->size('< 100K')->date('since 1 hour ago'); foreach ($finder->in('s3://bucket-name') as $file) { - // ... do something - - print $file->getFilename()."\n"; + // ... do something with the file } .. note::