Fatal error runnaround.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 */
      }




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux