1--TEST-- 2ReflectionFunction::getDocComment() 3--CREDITS-- 4Robin Fernandes <robinf@php.net> 5Steve Seear <stevseea@php.net> 6--INI-- 7opcache.save_comments=1 8opcache.load_comments=1 9--FILE-- 10<?php 11 12/** 13 * my doc comment 14 */ 15function foo () { 16 static $c; 17 static $a = 1; 18 static $b = "hello"; 19 $d = 5; 20} 21 22/*** 23 * not a doc comment 24 */ 25function bar () {} 26 27 28function dumpFuncInfo($name) { 29 $funcInfo = new ReflectionFunction($name); 30 var_dump($funcInfo->getDocComment()); 31} 32 33dumpFuncInfo('foo'); 34dumpFuncInfo('bar'); 35dumpFuncInfo('extract'); 36 37?> 38--EXPECTF-- 39string(%d) "/** 40 * my doc comment 41 */" 42bool(false) 43bool(false) 44 45