Fatal error runnaround.
| From: | Jeffry Killen | Date: | Thu, 26 Mar 2020 19:03:35 +0000 |
| Subject: | Fatal error runnaround. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327076@lists.php.net to get a copy of this message | ||
Hello;
I am working out some utilities.
One for sampling async processing progress.
The following is the totality of php in an html
interface page, accept for some print statements
to produce the $_out['error'] strings.
_ASYNC_SAMPLER is defined in asyncSamplerClass.php
Why would require complain?
(if I comment out the line causing the fatal error everything
else works fine)
php v 7.1.16; MacOS High Sierra (localhost)
<?php
$_fileSelf = basename($_SERVER['PHP_SELF']);
$_jsTest = '';
$_out = [];
require('php/asyncSamplerClass.php'); // *** FATAl ERROR complaint, see below ***
//$_test = (new
_ASYNC_SAMPLER('testOut.txt'))->sampler(['first'=>'test',
'second'=>'another test?'], true, true);
require('php/csFind.php');
$_CSF = (new _CS_FIND())->proc('coDeBase.php');
switch($_CSF['error'])
{
case true;
$_out['error'] = "found it with wrong character case spelling";
break;
case false:
$_out['error'] = "case sensitive find didn't find it"; // -> appears
in interface
break;
default:
$_out['error'] = $_CSF['error'];
break;
}
?>
Fatal error: Cannot declare class _ASYNC_SAMPLER, because the name is
already in use in /path/lab_8/php/asyncSamplerClass.php on line 14
line 14 in asyncSamplerClass.php
final class _ASYNC_SAMPLER
{
/* class code */
}