Results of 1 - 10 of about 58 for something (0.004 sec.)
- Pool::submit — Submits an object for execution | PHP 8.3 16056
- Pool::submit (PECL pthreads >= 2.0.0) Pool::submit — Submits an object for execution 説明 public function Pool::submit ( Threaded $task ): int Submit the task to the next Worker in the Pool パラメータ task The task for execution 戻り値 the
... rk extends Threaded { public function run () { /* ... */ } } class MyWorker extends Worker { public function __construct ( Something $something ) { $this -> something = $something ; } public function run () { /** ... **/ } } $pool = new Pool ( 8 , \MyWork ... er ::class, [new Something ()]); $pool -> submit (new MyWork ()); var_dump ( $pool ); ?> 上の例の出力は以下となります。 object(Pool)#1 (6) { ["size": ... d]=> int(8) ["class":protected]=> string(8) "MyWorker" ["workers":protected]=> array(1) { [0]=> object(MyWorker)#4 (1) { ["something"]=> object(Something)#5 (0) { } } } ["work":protected]=> array(1) { [0]=> object(MyWork)#3 (1) { ["worker"]=> object(MyWor ...
-
https://man.mtool.work/php/8.3/pool.submit.html
- Pool::__construct — Creates a new Pool of Workers | PHP 8.3 12339
- Pool::__construct (PECL pthreads >= 2.0.0) Pool::__construct — Creates a new Pool of Workers 説明 public function Pool::__construct ( int $size , string $class = ? , array $ctor = ? ) Construct a new pool of workers. Pools lazily create the
... sed to new workers' constructors 例 例1 Creating Pools <?php class MyWorker extends Worker { public function __construct ( Something $something ) { $this -> something = $something ; } public function run () { /** ... **/ } } $pool = new Pool ( 8 , \MyWork ... er ::class, [new Something ()]); var_dump ( $pool ); ?> 上の例の出力は以下となります。 object(Pool)#1 (6) { ["size":protected]=> int(8) ["class":prot ... > string(8) "MyWorker" ["workers":protected]=> NULL ["work":protected]=> NULL ["ctor":protected]=> array(1) { [0]=> object(Something)#2 (0) { } } ["last":protected]=> int(0) } 他のマニュアルの関連ページ DuckDB I/O DuckDB PostgreSQL Extension Connection Po ...
-
https://man.mtool.work/php/8.3/pool.construct.html
- 定数 | PHP 8.3 9470
- 定数 目次 構文 自動的に定義される定数 マジック定数 定数は、値のためのID(名前)です。この名前が示すように、定数の値は スクリプト実行中に変更できません ( マジック定数 は例外です。これは実際は定数ではありません)。 定数は大文字小文字を区別します
... 。 ヒント ユーザーレベルでの命名の手引き も参照ください。 例1 有効/無効な定数名の例 <?php // 有効な定数名 define ( "FOO" , "something" ); define ( "FOO2" , "something else" ); define ( "FOO_BAR" , "something more" ); // 無効な定数名 define ( "2FOO" , "some ... 、避けるべき。 // 将来 PHP に定数の予約語が追加された場合に // スクリプトが動作しなくなる可能性がある define ( "__FOO__" , "something" ); 注意 : 本節の目的においては、文字は a-z, A-Z, および128から255まで (0x80-0xff)のASCII文字を指します。 スーパーグローバ ...
-
https://man.mtool.work/php/8.3/language.constants.html
- Basic usage for LuaSandbox | PHP 8.3 8094
- Basic usage for LuaSandbox Once you've compiled PHP with LuaSandbox support, you can begin using LuaSandbox to safely run user-provided Lua code. 例1 Execute some Lua code <?php $sandbox = new LuaSandbox ; $sandbox -> setMemoryLimit ( 50 *
... , 'output' => function ( $string ) { echo " $string \n" ; }, 'error' => function () { throw new LuaSandboxRuntimeError ( "Something is wrong" ); } ] ); // Execute some Lua code, including callbacks into PHP and into Lua $luaCode = <<<EOF php.output( "Hel ... , $message ) = $sandbox -> loadString ( 'return pcall( php.error )' )-> call (); assert ( ! $ok ); assert ( $message === 'Something is wrong' ); ?> 他のマニュアルの関連ページ Linux JM assert(3) FastAPI Async Tests Linux JM assert_perror(3) Docker Amazon ...
-
https://man.mtool.work/php/8.3/luasandbox.examples-basic.html
- Error::getPrevious — 直前の Throwable を返す | PHP 8.3 8006
- Error::getPrevious (PHP 7, PHP 8) Error::getPrevious — 直前の Throwable を返す 説明 final public function Error::getPrevious (): ? Throwable 直前の Throwable( Error::__construct() の第三パラメータ)を返します。 パラメータ この関数にはパラメ
... Stuff () { try { throw new TypeError ( "You are doing it wrong!" , 112 ); } catch( Error $e ) { throw new MyCustomError ( "Something happened" , 911 , $e ); } } try { doStuff (); } catch( Error $e ) { do { printf ( "%s:%d %s (%d) [%s]\n" , $e -> getFile ( ... ss ( $e )); } while( $e = $e -> getPrevious ()); } ?> 上の例の出力は、 たとえば以下のようになります。 /home/bjori/ex.php:8 Something happened (911) [MyCustomError] /home/bjori/ex.php:6 You are doing it wrong! (112) [TypeError] 参考 Throwable::getPrevious( ...
-
https://man.mtool.work/php/8.3/error.getprevious.html
- dbase_numrecords — Gets the number of records in a database | PHP 8.3 8006
- dbase_numrecords (PHP 5 < 5.3.0, dbase 5, dbase 7) dbase_numrecords — Gets the number of records in a database 説明 function dbase_numrecords ( resource $database ): int Gets the number of records (rows) in the specified database. 注意 : Re
... ( $i = 1 ; $i <= $record_numbers ; $i ++) { $record = dbase_get_record ( $db , $i ); if (! $record [ 'deleted' ]) { // do something with the $record } else { // do something with the deleted $record or ignore it } } } ?> 参考 dbase_numfields() - Gets the ...
-
https://man.mtool.work/php/8.3/function.dbase-numrecords.html
- Exception::getPrevious — 前の例外(Throwable)を返す | PHP 8.3 7918
- Exception::getPrevious (PHP 5 >= 5.3.0, PHP 7, PHP 8) Exception::getPrevious — 前の例外(Throwable)を返す 説明 final public function Exception::getPrevious (): ? Throwable 前に発生した Throwable ( Exception::__construct() に渡された第三パラメ
... new InvalidArgumentException ( "You are doing it wrong!" , 112 ); } catch( Exception $e ) { throw new MyCustomException ( "Something happened" , 911 , $e ); } } try { doStuff (); } catch( Exception $e ) { do { printf ( "%s:%d %s (%d) [%s]\n" , $e -> getFi ... ss ( $e )); } while( $e = $e -> getPrevious ()); } ?> 上の例の出力は、 たとえば以下のようになります。 /home/bjori/ex.php:8 Something happened (911) [MyCustomException] /home/bjori/ex.php:6 You are doing it wrong! (112) [InvalidArgumentException] 参考 Thro ...
-
https://man.mtool.work/php/8.3/exception.getprevious.html
- date — Unixタイムスタンプを書式化する | PHP 8.3 7918
- date (PHP 4, PHP 5, PHP 7, PHP 8) date — Unixタイムスタンプを書式化する 説明 function date ( string $format , ? int $timestamp = null ): string 指定された引数 timestamp (Unixタイムスタンプ) を、与えられた フォーマット文字列によりフォーマット
... になりました。 例 例1 date() の例 <?php // set the default timezone to use. date_default_timezone_set ( 'UTC' ); // Prints something like: Monday echo date ( "l" ) . "\n" ; // Prints something like: Monday 8th of August 2005 03:12:46 PM echo date ( 'l jS ... a " . date ( "l" , mktime ( 0 , 0 , 0 , 7 , 1 , 2000 )) . "\n" ; /* use the constants in the format parameter */ // prints something like: Wed, 25 Sep 2013 15:28:57 -0700 echo date ( DATE_RFC2822 ) . "\n" ; // prints something like: 2000-07-01T00:00:00+00 ...
-
https://man.mtool.work/php/8.3/function.date.html
- apcu_dec — 保存した数値を減らす | PHP 8.3 7830
- apcu_dec (PECL apcu >= 4.0.0) apcu_dec — 保存した数値を減らす 説明 function apcu_dec ( string $key , int $step = 1 , bool &$success = ? , int $ttl = 0 ): int | false 保存した整数値を減らします。 パラメータ key 減らしたい値のキー。 step 減ら
... 戻り値 成功した場合に key の現在値を返します。 失敗した場合に false を返します 例 例1 apcu_dec() の例 <?php echo "Let's do something with success" , PHP_EOL ; apcu_store ( 'anumber' , 42 ); echo apcu_fetch ( 'anumber' ), PHP_EOL ; echo apcu_dec ( 'anumber ... astring' , 1 , $fail ); var_dump ( $ret ); var_dump ( $fail ); ?> 上の例の出力は、 たとえば以下のようになります。 Let's do something with success 42 41 31 21 bool(true) Now, let's fail bool(false) bool(false) 参考 apcu_inc() - 保存した数値を増やす 他のマニ ...
-
https://man.mtool.work/php/8.3/function.apcu-dec.html
- apcu_inc — 保存した数値を増やす | PHP 8.3 7830
- apcu_inc (PECL apcu >= 4.0.0) apcu_inc — 保存した数値を増やす 説明 function apcu_inc ( string $key , int $step = 1 , bool &$success = ? , int $ttl = 0 ): int | false 保存した整数値を増やします。 パラメータ key 増やしたい値のキー。 step 増や
... 戻り値 成功した場合に key の現在値を返します。 失敗した場合に false を返します 例 例1 apcu_inc() の例 <?php echo "Let's do something with success" , PHP_EOL ; apcu_store ( 'anumber' , 42 ); echo apcu_fetch ( 'anumber' ), PHP_EOL ; echo apcu_inc ( 'anumber ... astring' , 1 , $fail ); var_dump ( $ret ); var_dump ( $fail ); ?> 上の例の出力は、 たとえば以下のようになります。 Let's do something with success 42 43 53 63 bool(true) Now, let's fail bool(false) bool(false) 参考 apcu_dec() - 保存した数値を減らす 他のマニ ...
-
https://man.mtool.work/php/8.3/function.apcu-inc.html