123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- Default values (static scalar tests)
- -----
- <?php
- function a(
- $b = null,
- $c = 'foo',
- $d = A::B,
- $f = +1,
- $g = -1.0,
- $h = array(),
- $i = [],
- $j = ['foo'],
- $k = ['foo', 'bar' => 'baz']
- ) {}
- -----
- array(
- 0: Stmt_Function(
- byRef: false
- name: a
- params: array(
- 0: Param(
- type: null
- byRef: false
- variadic: false
- name: b
- default: Expr_ConstFetch(
- name: Name(
- parts: array(
- 0: null
- )
- )
- )
- )
- 1: Param(
- type: null
- byRef: false
- variadic: false
- name: c
- default: Scalar_String(
- value: foo
- )
- )
- 2: Param(
- type: null
- byRef: false
- variadic: false
- name: d
- default: Expr_ClassConstFetch(
- class: Name(
- parts: array(
- 0: A
- )
- )
- name: B
- )
- )
- 3: Param(
- type: null
- byRef: false
- variadic: false
- name: f
- default: Expr_UnaryPlus(
- expr: Scalar_LNumber(
- value: 1
- )
- )
- )
- 4: Param(
- type: null
- byRef: false
- variadic: false
- name: g
- default: Expr_UnaryMinus(
- expr: Scalar_DNumber(
- value: 1
- )
- )
- )
- 5: Param(
- type: null
- byRef: false
- variadic: false
- name: h
- default: Expr_Array(
- items: array(
- )
- )
- )
- 6: Param(
- type: null
- byRef: false
- variadic: false
- name: i
- default: Expr_Array(
- items: array(
- )
- )
- )
- 7: Param(
- type: null
- byRef: false
- variadic: false
- name: j
- default: Expr_Array(
- items: array(
- 0: Expr_ArrayItem(
- key: null
- value: Scalar_String(
- value: foo
- )
- byRef: false
- )
- )
- )
- )
- 8: Param(
- type: null
- byRef: false
- variadic: false
- name: k
- default: Expr_Array(
- items: array(
- 0: Expr_ArrayItem(
- key: null
- value: Scalar_String(
- value: foo
- )
- byRef: false
- )
- 1: Expr_ArrayItem(
- key: Scalar_String(
- value: bar
- )
- value: Scalar_String(
- value: baz
- )
- byRef: false
- )
- )
- )
- )
- )
- returnType: null
- stmts: array(
- )
- )
- )
|