Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Notice when parsing anonymous function #70

Closed
nazar-pc opened this issue Jun 25, 2016 · 1 comment
Closed

Notice when parsing anonymous function #70

nazar-pc opened this issue Jun 25, 2016 · 1 comment

Comments

@nazar-pc
Copy link

Preparation

test.php:

<?php
spl_autoload_register(function () {});

run.php:

<?php
require_once __DIR__.'/vendor/autoload.php';
new \Zend\Code\Reflection\FileReflection('/test.php');
~> composer require zendframework/zend-code:3.0.2
~> php -v
PHP 7.0.7-4ubuntu2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans

Execution

~> php run.php

Expected output

Nothing

Actual output

PHP Notice:  Uninitialized string offset: 1 in /vendor/zendframework/zend-code/src/Scanner/TokenArrayScanner.php on line 586

Notice: Uninitialized string offset: 1 in /vendor/zendframework/zend-code/src/Scanner/TokenArrayScanner.php on line 586
@weierophinney
Copy link
Member

Perfect; I've used this to write a test case, and can now reproduce the issue. Thanks, @nazar-pc.

weierophinney added a commit to weierophinney/zend-code that referenced this issue Jun 27, 2016
- Added a failing test case, per zendframework#70.
- Discovered that the structure addressed can be either an array
  (existing assumption) or a string.
- Updated the assignment to check for array before assigning, and use
  the string value if present instead.
weierophinney added a commit that referenced this issue Jun 27, 2016
basz added a commit to basz/zend-code that referenced this issue Sep 28, 2016
* 'master' of https://github.com/zendframework/zend-code: (39 commits)
  Fix Travis code convention
  Fix Travis code convention
  Fix Travis code convention
  Fix Travis code convention
  1. Fix ClassScanner::getInterfaces() which don't work with Interface. 2. add TestCase  ClassScannerTest::testGetInterfacesFromInterface().
  Remove fast_finish flag
  Bumped to next dev version (3.0.5)
  Added CHANGELOG for zendframework#75
  Separated new tests to separate methods
  testCorrectExtendNamesFromGlobalNamespace
  add tests
  Added CHANGELOG for zendframework#59
  Update ClassGenerator.php
  fast fix
  Bumped to next dev version (3.0.4)
  Set date for 3.0.3
  Added CHANGELOG for zendframework#72
  Added CHANGELOG for zendframework#69
  Added CHANGELOG for zendframework#61
  Provide a fix for issue zendframework#70
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants