3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This file is part of the symfony framework. * * (c) Fabien Potencier <fabien.potencier@symfony-project.com> * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ /** * RokCommon_Service_Container_AbstractLoader is the abstract class used by all built-in loaders that are file based. * * @package symfony * @subpackage dependency_injection * @author Fabien Potencier <fabien.potencier@symfony-project.com> * @version SVN: $Id: File.php 10831 2013-05-29 19:32:17Z btowles $ */ abstract class RokCommon_Service_Container_Loader_File extends RokCommon_Service_Container_AbstractLoader { protected $paths = array(); /** * Constructor. * * @param RokCommon_Service_Container_Builder $container A RokCommon_Service_Container_Builder instance * @param string|array $paths A path or an array of paths where to look for resources */ public function __construct(RokCommon_Service_Container_Builder $container = null, $paths = array()) { parent::__construct($container); if (!is_array($paths)) { $paths = array($paths); } $this->paths = $paths; } /** * Loads a resource. * * A resource is a file or an array of files. * * The concrete classes always have access to an array of files * as this method converts single file argument to an array. * * @param mixed $resource The resource path */ public function load($resource) { if (!is_array($resource)) { $resource = array($resource); } return parent::load($resource); } protected function getAbsolutePath($file, $currentPath = null) { if (self::isAbsolutePath($file)) { return $file; } else if (null !== $currentPath && file_exists($currentPath.DIRECTORY_SEPARATOR.$file)) { return $currentPath.DIRECTORY_SEPARATOR.$file; } else { foreach ($this->paths as $path) { if (file_exists($path.DIRECTORY_SEPARATOR.$file)) { return $path.DIRECTORY_SEPARATOR.$file; } } } return $file; } static protected function isAbsolutePath($file) { if ($file[0] == '/' || $file[0] == '\\' || (strlen($file) > 3 && ctype_alpha($file[0]) && $file[1] == ':' && ($file[2] == '\\' || $file[2] == '/') ) ) { return true; } return false; } }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught Error: Class "RokCommon_Service_Container_AbstractLoader" not found in /in/rTtXT:20 Stack trace: #0 {main} thrown in /in/rTtXT on line 20
Process exited with code 255.
Output for 7.3.12 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught Error: Class 'RokCommon_Service_Container_AbstractLoader' not found in /in/rTtXT:20 Stack trace: #0 {main} thrown in /in/rTtXT on line 20
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33
Fatal error: Class 'RokCommon_Service_Container_AbstractLoader' not found in /in/rTtXT on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.37, 5.6.0 - 5.6.28
Fatal error: Class 'RokCommon_Service_Container_AbstractLoader' not found in /in/rTtXT on line 21
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/rTtXT on line 20
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected T_CLASS in /in/rTtXT on line 20
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/rTtXT on line 20
Process exited with code 255.

preferences:
219.86 ms | 401 KiB | 350 Q